Simple. Karlsson plays less games, he'll score less Points and the Sharks can then sign him on a long term deal for cheaper. But if Karlsson had ended up with a career high in Points this season, the Sharks would most likely have had to pay him another million or two on top of what they'll end up paying him on his next deal now.
With Thornton it gives the Sharks an easy out to not sign him next year. It's clear that the Sharks don't want to hold on to Thornton until he truly declines. The Sharks are looking to avoid what Anaheim did with Selanne and are looking to copy what Calgary did with Iginla instead. If Thornton ends up with 40-45 Points this year, which he most likely will, no Sharks fan will be upset if he's not re-signed.