I've always understood the 'loins' to be the part of the anatomy involved with reproduction, so 'girding' them would be protecting them in some way, by way of a cup more modernly, or armor in an early reference.
So basically it would mean, cover your triangularly sensitive area (since there are both male and female soldier-types).
Girding your Loins I think is Roman (I want to say for wrestlers), where they would wear heavy leather belts to protect the kidneys. So the metaphor got extended into generic struggle/battle with something.
And please no one girds their loins, they strap on their hobnails.