My teachers don't really care since they barely know what they are. When a teacher asked one time, we said, "Oh, they are tamagotchis." and they said, "So everyone has one?" we said "Yeah, pretty much." And the teacher said, "Everyone except me!" and smiled. She's a very nice, young teacher so she thought they were cool. ^_^ Another one of my teachers who isn't as young was like "Oh, I remember having one of those!" Even so, one teacher banned them in his class at my school. Everyone still brought them and stayed on high security though.
Basically, there's a Tamagotchi "code of honor" type of thing. (At least at my school it seems) If you get one and want to take it to school, you have to keep it hidden from teachers as much as possible, only care for it between classes and at recess, lunch, study hall, and on the bus, turn the sound off, and keep it hidden in a good place (locker, desk, binder, backpack, pocket, etc.). Also, if you have a tamagotchi that is uncovered by a teacher and you are given a warning about it, you can't take it to school for awhile, like a couple days. And if you repeatedly get caught then everyone will be angry and tell you to stop bringing it to prevent a schoolwide tamagotchi ban.