Brian, cleaning the carpets and re-painting cost money as well. The OP asked if the landlord is allowed to charge him for that. In the case of the first two, the are amortized over 3 and 5 years I believe. Locks I don’t know but I’m guessing that would fall under normal wear and tear.
Josh