Be thankful they stopped your labor, and your little one can develop more before birth. I do not agree with them not explaining the reasons why they gave you the shot. That is wrong, and I'd be pretty mad too. Try not to stress though, as it was what was best for your baby. Better to stay pregnant than your child to spend 6-8 weeks in the hospital.
Talk to your doctor about your concerns with the hospital staff. He/she can relay that to them and tell them that they should be doing their job of explaining exactly what they're giving you or any other patient. (unless of course it is an emergency situation, and there's no time for that for fear of a patient or unborn child dying)
Good luck with the rest of your pregnancy and congrats!