I wouldn't ever book any 3* or less hotel with a third party agency before doing some research on tripadvisor or similar. The 4* chain hotels are "usually" pretty safe. 3* means different things in different countries - in some places it simply means that there is a chair and/or TV in the room

But, there is no excuse for a filthy room in any hotel category. I can't imagine that many, if any, of the hotel agencies do any real inspecting of the properties they offer.