Vice News (one of my favorite independent journalism sites) has
an article covering exactly
why a small summer resort town in the Caucasus was chosen as the site of the Olympics.
Basically, it's described as the equivalent of George W. Bush proving that he won the Iraq War by holding the Super Bowl in Kuwait.
Many Russians are still pretty upset about the breakup of the Soviet Union; imagine the US losing all of their territory west of the Rockies. The fall of communism meant that Russia was no longer a superpower, and even the ones who don't want to return to the communist government want their power back. The effective tie during the first Chechen war of independence was an embarrassment: the great Red Army beaten bloody by a pack of rebels with homemade submachine guns. Putin is former KGB and practically a James Bond villain, and he wanted revenge. So he started the new Chechen war and turned Grozny into literally the most destroyed city in the world, then rebuilt it.
Holding the Olympic games in Sochi is basically Putin's way of "proving" that he won the war against the rebels. He's mocking them.