I've had my share of the problems and arguments involving security deposits over the years. I see posts on this often here. A solution I've implemented that works for me and the logic behind it is this:
The logic is supposed to be that the security deposit keeps the tenant in line and gets them to leave the place clean and undamaged. Some of us are better at tenant selection and training than others.
I have mainly class C type properties and tenants. I've found that these level tenants almost always leave a mess and damages and lose their entire deposit and more. The key, to me, is the ability to collect from them if I get a judgement. Many are not collectible, know it and laugh about it, knowing they will never pay.
So, what I've done is this:
I do not charge a security deposit.
Instead , I charge a first months rent of 2 times the normal rent (for example, $1000 instead of $500). I don't say it is a cleaning charge, a pet charge or anything else. Just rent. Because these tenants typically both smoke and have pets (several), they are GLAD to find someone that will rent to them at all.
Then I tell them that IF they follow the lease and pay on time, future monthly payment will be $500 instead of $1000. If not, it is $1000. I simply ask them to leave the place broom clean when they move.
This has worked better for me than dealing with / arguing over security deposits.
Now I realize some states have rules that may say this is wrong or not allowed. But I've had little problem with it.
When they leave I expect to have to clean some. If they leave a mess, I just add it up and try to get a judgement and hopefully collect. Like many say, if you screen really well and try to choose tenants that have longer term and better jobs, you have less trouble.