There are several instances in the films of Jedi being overwhelmed by multiple blaster shots - Jango Fett even pulls the trick off on his own at point blank range. The Jedi use lightsabers because Lucas was a fan of Samurai movies, and because swords are Just Cooler. Glowing energy swords even more so.
Dune had personal shield technology, with a wrinkle that they only stopped high-velocity impacts. A relatively low-speed sword thrust would penetrate, and there were some ultra-low-velocity pistols (maula pistols, I think) that could penetrate but didn't do much damage, so you had to be a very good shot for them to be worth carrying. The other fun bit of shields was that if hit with a lazgun, they went up in a fusion explosion, and so did the shooter. Put together, that made for an environment where up-close-and-personal was the only way to go. Herbert also managed to outlaw AIs and anything that might even begin to look a little bit like a thinking machine. So, while there were super-soldier types (the Fremen, the Sardaukar, Duncan and Gurney), they were never up against never-miss automata.
Peter F. Hamilton's Commonwealth has space-borne weaponry of almost unimaginable power (nova bombs are old news), so ground combat tends not to be army-versus-army but more agent-versus-agent. The agents are usually seriously upgraded, including built-in weapons, shields, computers and jacked-up reflexes, but are very hard to spot. They would generally prefer to get the job done without a fight, so when fights happen it tends to be because they tripped over each other - so all fights are never-miss automata close-in one-on-one. Sometimes a punch is the best way to go, especially if you've got a shield-penetrating energy-dump weapon on the end of your fist.
I think that's all the excuses for melee I can think of...