They can, they do and it just stinks when it happens to you.
I have to say though, I've been really lucky. When I left my apt. in NC, they had someone who wanted to move in right away, so they actually gave me more money than I expected to get back from my paid rent, security and other deposits.
I spent the next 3 years in the same apartment up in the Maitland area and had heard horror stories from friends who had moved out previously. My one friend got hit really hard with cleaning and additional redecoration fees. She had been in her apartment for about a year. So, when I left, I thought they'd really get me. Not that I left the apartment in terrible condition, but one of the glass shelves was broken and I hadn't been able to clean as well as I had wanted to before leaving. Well, much to my surprise, I got my entire deposit back! Could've knocked me over with a feather.
I honestly think the apartment complexes use cleaning fees as a way of making extra money off people when they're having problems with occupancy. I think they will look to see if the apartment is going to be re-rented quickly after you move out. If it is, they're not going to be quite as worried about losing money on the unit after you move. But if they've got several of the same size units open with lots more leases coming due, they tend to be much pickier and will make you pay for a lot of extra things. Of course the fees are all spelled out in small print somewhere just to cover their own butts.
In addition, I think the longer you stay in a complex as a "good neighbor" impacts on how they consider the state you leave the apartment in. In NC, I'd been there for 2 years, rent was always on time and as far as I know, no one ever complained about me. In addition, I tried to keep a good relationship with the office staff and maintenance guys while I lived there and I think both of those things played in my favor. Same thing in Maitland - was on good terms with the girls in the office, never bothered them for stupid stuff, never had any complaints against me, etc. So, with 3 years good history, they maybe had a bit rosier colored glasses when they inspected my apartment after I left and cut me a bit of slack on things that they could have charged me for according to my lease termination notice.
Most apartments will do a walk through with you before you leave so they can let you know of anything that needs to be fixed before you go. If they don't offer, ask in your leasing office because you have the right to try to fix things before leaving in order to avoid any extra charges.