Ralph McQuarrie is responsible for many of the designs for “Star Wars.” including those of the storm troopers. But intriguingly, some of his early concept art for the original 1977 film features a lightsaber-wielding and shield-carrying stormtrooper staring down Chewbacca and Han Solo (who also wields a lightsaber).
It was not uncommon to have swords and shields in space; It was a pretty common trope in science fiction in the 50s and 60s. Isaac Asimov, one of the greatest science fiction writers of all time, introduced the idea of energy swords in space in his short story “The Traders” and later developed the idea in “The Complete Adventures of Lucky Starr.” Many of the science fiction works that inspired “Star Wars,” from “Buck Rogers” to “Dune,” also featured swords in futuristic settings. Especially “Dune”He found an elaborate way to justify this by disabling projectile weapons in his universe.
Eventually, Lucas would reduce the number of swords used in “Star Wars” by making them available only to Jedi. Why the Stormtroopers got their shields is another matter (though they certainly could have used them, given how ineffective their armor was).
There is at least one lightsaber-wielding stormtrooper in canon, though. In the 2015 “Star Wars” Marvel comic by Jason Aaron and Stuart Immonen, we meet Sergeant Kreel, a member of Vader’s 501st Legion who battles Luke Skywalker with a lightsaber several times. Yes, he stole the lightsaber from the Hutt’s collection of Jedi artifacts and had no Jedi training, but it still counts!