I completely understand where you're at, OP.
I know it isn't the same, but there are parallels with living with an alcoholic. They know there are certain drinks (ie alcoholic ones) that they should avoid. They know the end result could be liver damage and death. If you point their drinking out to them they resent you / you just want to spoil their fun.
But their addiction will eventually harm and likely kill them, and it has an impact on you, and any children, every day - right up to the point at which you become a widow. You are their carer, nor their lover.
In your case, he knows what he needs to do to be healthier, to live longer and to make life better for him, you and his children. He has to avoid certain foods. But he chooses those foods over everything else, like the alcoholic chooses alcohol.
He is a grown up, he makes his own choices. But when those choices affect other people, people who have supported, cared, tried to help, picked up the slack, dealt with the impacts, and face a life of being a carer and then widowed early, then those people also have a choice. You can choose to leave.
He has it in his power to make changes and reclaim his life and his marriage. If he chooses carbs over that, then you're doing the right thing in leaving.