I run into this quite a bit, improperly wired exhaust fans in the attic space. These thermostats are designed for the wires to be placed inside the box with a wire clamp and have holes for mounting.
Improper installation may cause damage to the unit and possibly fire. It is recommended that these fans be properly installed per manufacturers instruction.