I'm going to disagree, slightly. There is a way to have class pets ethically (although in most cases that doesn't happen).
To do this properly, there would need to be a teacher who enforces proper care (this will inevitably mean that the teacher is buying supplies out of their own pocket), creates strict rules for the children (do not wake a sleeping hamster, wash hands before/after, etc.), and takes the hamster home during school holidays. None of this letting children run amuck unsupervised with an animal. If the rules are not followed, the children lose hamster privileges, and the hamster goes to live at home with the teacher.
I'm sorry you all had poor class pet experiences. It should be an opportunity to learn how to treat animals with respect. But it sounds like there was a total lack of guidance. The children shouldn't be the ones deciding the cleaning schedule, and they shouldn't be wandering around with the hamster.
yes I agree, though a hamster probably wouldn't be a very good class pet still