It was for his family alone he took this sudden decision. He agreed for marrying again, said yes to Sanchi's ristha, tolerated all her nonsense, tried forgetting Ganga all for the sake of family.
If he hadn't met Anandi and seen Sanchi's real face he would surely have gone ahead with the wedding for the sake of his family. Its only when he heard Sanchi belittling and making fun of his family and way of life and her plans to separate him from them that he decided enough of enough. That's what he asked in the temple as well that for whom he is going ahead with this marriage they will be the ones most hurt by this. Ganga didn't even enter his mind in the past several hours till that phone call came for him.
Somewhere I have perverse satisfaction with the way he sprung this surprise on the Shekhars and indirectly his family. Didn't they do the same and catch him unawares when they brought up this rishta suddenly where he wasn't even given time to think about it much but hurried into saying yes? So they totally deserve what they got 😈!