A teacher allegedly took a camera from his principal's office and hid it after a cleaner found the device inside a primary school bathroom.