spoiler........................................................................................................................................................................................................................................................................................................................................................................................................................................................................
so the princess's plan to pretend she was pregnant with the Duke's baby, Sophia was in on it. She also knows that the Duke is "hiding" that deal from her, but she either doesn't care enough or finds it funny so she doesn't bother telling him (been a bit since i read this so can't remember for which reason).
this means that for Sophia her loyalty/friendship for the Princess (that extended to the princess's baby) is way more important to her than the duke or her son. She willingly sidelined her son for the princess's baby knowing he wasn't the duke's child.
remember the the ML was always the unfavored child growing up...princess's baby got spoiled rotten/pampered.
Both the Duke and Sophia's choice/reason of choosing an heir just showed how unfit there to be parents due to them prioritizing their "loves/friendships"
At least we know why Sophia didn't accept his advances. From start to end, he's selfish. People might try to argue that perhaps he's just lying to make things easier. But a sincere heart wins everything. He might love Sophia but that love is not pure nor unconditional. How can you love a person but not care for the child you've had with her. How can you keep secrets from her, even about the person she held dear most.