From a purely canon standpoint, the lightsaber is truly the Superman of the Star Wars Universe. It's a bird! It's a plane! It's an energy sword that cuts through everything! While the ability to slice through endless droves of cannon fodder and cut through the most protective of blast-doors makes for epic, exciting film sequences, it doesn't allow for an expanded universe where lightsaber-wielding heroes (and villains) can venture outward and encounter those who are not force-sensitive. We need a kryptonite. We need a mysterious (and plot-hole-ridden) mineral that can stand up to the strike of a lightsaber, even if the lore cannot agree on exactly how it works. We need Cortosis!
Cortosis appears in three primary places in the Star Wars lore: Timothy Zahn's
Vision of the Future, Drew Karpyshyn's
Darth Bane series, and our beloved KOTOR. Both Bioware and Karpyshyn have treated Cortosis as a "lightsaber-resistant" material that has been incorporated into everything from ship hulls to body armor (in the form of Cortosis-Weave). Zahn's approach is slightly different. In
Vision of the Future, Mara Jade Skywalker explains that Cortosis directly affects the way a lightsaber works. There is actually a detailed description of the electronics of the lightsaber, but it basically causes the system to crash and prevents the saber from starting again for a period of time. No matter which version of Cortosis you prefer, one thing is clear: The mineral is used purely as a means to allow for expanded storylines.
The Star Wars universe would be (to me, at least) much less exciting if the Sith could completely wipe out literally anything that stood in its path. There would be no opportunities for the Jedi to need the Republic's armies as much as the armies need them. Sure, the grand scope of the Jedi vs. Sith (as well as all of their civil wars) are what drive most of the galaxy's storylines, but it's the struggles of the "regular folk" that bring everything together. Cortosis, along with a number of other anti-force elements, allow for those stories to happen.
That's the lore explanation. As
convenient and "kryptonite-like" as Cortosis is, in my opinion it's something that is completely necessary for LucasArts to continue telling stories. It's also something that Bioware is going to have to rely on for an MMO to work. As much as we may hate hacking and slashing with lightsabers and having no visual effect, there just has to be a line in a video game that allows for multiple classes, some non-force, to coexist and actually stand a chance against each other. Is that frustrating? Possibly. But the world that LA and Bioware are crafting, the depth of story, and everything else that they have yet to reveal are going to far outweigh the inconveniences caused by the most powerful melee weapon in the universe.
Wookiepedia has a great article on Cortosis that also has links to other force-resistive materials like phrik and Mandalorian Iron. Check it out here...
http://starwars.wikia.com/wiki/Cortosis