Bottas qualified in pole position and led the race for the first half until Toto Wolff ordered him to let Hamilton past.
Third-placed Sebastian Vettel was closing down on the World Championship leader so Bottas used his position to slow down the Ferrari.
Hamilton had a brief worry on lap 17 when he emerged from the pits behind Vettel but he quickly made amends by regaining his position with a smooth overtake on turn three.
From there, it was relatively comfortable as Mercedes secured a one-two finish with plenty of distance between themselves and Ferrari.
Red Bull had a brilliant race as both of their drivers started in the bottom three after incurring engine penalties.
Max Verstappen finished fifth on his 21st birthday, just ahead of team-mate Daniel Ricciardo.
Hamilton extends his lead over Vettel to 50 points with his success in Sochi.
“It’s actually quite a difficult day because Valtteri did a fantastic job all weekend and he was a real gentleman to let me by,” Hamilton said.
“He’s now not fighting for the Championship, where we are.
“It’s been such a great weekend for the team. they’ve done such an exceptional job to have this advantage over Ferrari.
“To have a one-two, usually we’d just be elated but I can understand how difficult it was for Valtteri and really he deserved to win.
“Championship wise, as a team we are trying to win both so today it was a real team effort. Whilst it doesn’t feel spectacular, I know he’s going to do well in races to come.”
Hamilton and Vettel were investigated over an incident on the 17th lap where the Brit tried to get past his rival.
Both drivers were cleared of any wrongdoing by the stewards.
“For me, he did move over to the inside and then he moved again and nearly put me in the wall. I thought that was a double move but I guess they didn’t see that,” Hamilton explained.
“Fortunately I was able to get out of the wall and then it was a question of who was going to brake later at the next corner and I wanted it more at the time.
“We shouldn’t have been in that position. I don’t understand how strategically we ended up in that place.”