It has to do with the wonderful "Shellshock" bug in bash. If an environment variable is defined as "() { X }; Y" it will define a function containing X - that part is fine, the bug is that when loading that variable bash will also execute Y.. a pretty big security risk for web servers and the like.
Hastily fixing this 25 year old bug breaks some existing software, who would have guessed? :)
In our case it is probably a combination of the
environment modules software(that I don't think is in use) and a newer bash on the frontend than on the compute nodes.
Anders