The penalty took place in the end zone, which meant a safety for the 49ers. That made the score 15-6 and essentially ended the game with a minute remaining. At least it was over until Harbaugh declined the penalty.
In a strange sequence, Harbaugh decided not to take the penalty (or the two points) because the Seahawks came up 1 yard short on the fourth-and-17 play. The ball was turned over on downs. Harbaugh preferred to take the ball up 13-6 rather than let the Seahawks attempt an onside free kick after a safety.
There's almost no way the Seahawks could have scored twice at that point, but Harbaugh's reasoning was sound. You never know what could happen.
"We can just kneel on the ball and the game will be over," Harbaugh said. "Otherwise, they can onside kick it and give them a chance."
When you have a chance to kneel on the ball to end the game, you take it. Even if that means taking points off the board.