Why is my shower head pipe very loose when the company installed a new tub and surround?
This is a picture of one example of a rough shower plumbing install:

As you can see, at the top there is a cross brace, and there is a 90 degree angle that's been mounted into that brace secured, preferably with screws but possibly with nails.
My guess?  Your shower head was braced with nails, some idiot hit your shower head pipe pretty hard and pulled the nails loose, and the sound you heard was one of the nails falling out.
It's not serious - as long as you don't put any weight on the shower head - and the fix will involve opening up the walls.  Technically you can fix it from behind, so you won't have to destroy tile in the process, but that's a harder way to do it.  Basically you have to pull the wall behind the shower, cut the pipe to the shower head, pull the brace, re-secure the shower head, replace the brace, and then fix the feed to the shower head w/ a connector.