Locking switches in enclosures won't prevent users from making a loop by plugging two wall jacks into each other, or creating the loop themselves, by accidentally plugging a little 5-port switch into their PC, laptop, and into their phone twice.
Yes, if you turn spanning tree on for all access ports (Not in porfast/fast-uplink mode), and make sure users cannot connect equipment to anything other than an access port,
Spanning tree will help stop loops. Instead, the port will enter a "blocking" state when periodic BPDUs sent out get looped back to the switch
The downside is, every single time a new port is brought online, the switch will not allow traffic from that port for the first 60 seconds.
This makes DHCP not work as well (when plugging a booted windows box back into the LAN, you will normally need to wait 60 seconds, ipconfig /flush and ipconfig /renew )
Still, it is a small annoyance that only occurs when bringing up a new network device (or after restarting a machine or network device), a much smaller annoyance than the global network being ocassionally disrupted by a broadcast storm.