This is exactly why I don't rent to pet owners, you probably should have expected this and calculated their deposit based on what it was to replace the carpet... when they were "begging" you to let them have their dog, politely let them know that it was a big possibility that the carpet will need to be replaced when they vacated the unit.
Pets can do a lot of damage, especially to careless tenants. You also have to be careful, tenants will lie and tell you they do not have pets when they do. Upon discovering pets are living on my property, I file for an immediate eviction based on lease violation. In my younger years I put up with it, but not now. There are also many good legal reasons not to allow pets; i.e if a tenant's pet bit someone on your property, you may be liable. Just not worth it, I like to sleep at night. I have my real estate attorney on speed dial, luckily she is a good friend or I'd have a large legal bill.