I’m a teacher and do not have a key to my classroom and it’s not the norm here for teachers to be able to lock the doors of a classroom during teaching hours (that would throw up all kinds of safeguarding issues), but maybe that differs from country to country.
However, even if a teacher does have keys to their classroom and can lock it it is still not a truly private space. It is still not a place where it is appropriate - from a privacy, safeguarding or hygiene point of view - to change a diaper (or indeed any other clothing). If you’re a teacher your leisure and recreational activities do not belong in the classroom, especially not if they are linked to a fetish, regardless of whether you can lock the door, because it is a public space belonging to your employer and, in the case of a classroom, which is intended for the use as a teaching space for children’s education, not a recreation room and certainly not a changing room.
The fact you changed a diaper in your classroom/ sucked on a paci and weren’t caught doesn’t make it okay, it just means you were also doing something inappropriate and were just lucky nobody ever found out.