as badass as it would be to have some chubby smaurai hacking his way through metal tanks, braided hair blowing in the wind as he deflected bullets and blood spattered across his mask....modern military simply isn't set up for it. even an argument could be made that swords have a place in the military we just don't roll that way.
a better question would be why did we ever move away from swords and towards guns. when we first started using them they were as likely to kill you as the other guy, and not even close to as accurate as a bow. the power i would guess was only marginally better if at all, but considering both could get the job done under any circumstance provided they connected the bows are vastly superior.
now a modern m16 i can understand being chosen over a sword. but a damn 1200's pistol over any other weapon? i just don't understand it.
The move to firearms was related to morale, the effect that a regiment of hand-cannoneers could have on the average-medieval-Joe was devastating. Most people had never even heard of gunpowder, a handful of shots was all it took to rout half the opposing army. Not to mention the effect it had on cavalry, even warhorses can be flighty if they don't know what to expect.