At first, I agreed. Swords didn't make any sense in the universe, UNTIL I researched and set myself down in the universe's science.
There's a reason I am lord nerd, king of fictional universes.
Even Mass Effect the first's Codex, shields are only designed for fast moving munitions, as bullets travel at the speed of light basically. Slow weapons have to contend against the Ceramic armour plating. It was the in-universe reason for Melee attacks kicking so much ass in the first game if you stormed (Sprint-punch) and why Vanguards are even viable at all. Storming a ship (like a pirate/raider) involves lots of close up fighting, meaning a weapon that functions well in close quarters and can penetrate shields becomes a must. Enter the good old fashioned sword. Humans have a tendency to romanticize our past, and I can assume other species would as well (I personally love the **** out of the Victorian Era), so we would bring back fighting styles that had been mere sport for centuries and repurpose them for the new era. Guns will remain king after all is said and done, but intimate situations call for intimate solutions.
Also yes, rule of cool wins out over everything ever.
TL;DR: I did the math, it works. Bioware handled it stupidly, but it works. Shepard should have been given access to swords, or there should at least have been a more obvious Codex entry or something.