Until recently, I spent much of my time working hard to elect Democrats to public office — but the early presidential campaigning pushed me away from the party, as well prompting my resignation from the board of Democrats for Life, where I had served since 2014.

For someone who is progressive on most issues, this decision doesn’t come easy. Like most Democrats, I believe government has an energetic role to play to support women, families and children. I support paid family leave, help with unaffordable child care, labor union rights, the Affordable Care Act, child and adoption tax credits and much else of the kind.

I’m worried about climate change. I’m an outspoken vegetarian. I believe in welcoming refugees and immigrants. I oppose needless wars.

But the party gave me no choice. Yes, ours was a small group, but as many as a third of Democrats identify as pro-life. Even when party leadership finally met with us, they didn’t take us seriously.

When we showed them that pro-life Democrats would beat Republicans in certain districts, it didn’t matter. Even when we called for more reproductive choices for women with difficult pregnancies through services like perinatal hospice care, party leaders ignored us.

Anything even hinting that abortion is less than good now violates party orthodoxy.

Normally, Democrats are the party of energetic government protecting the vulnerable from violence. But when it comes to abortion, elite Democrats turn into hard-core libertarians, believing the state has no business getting involved in the private choices of individuals. Abortion is merely “health care,” and the unborn child, unimaginably vulnerable even when wanted, is made invisible and violently discarded.

On this topic, at least, the party has dug in on the side of what Pope Francis calls the “throwaway culture” — the troubling modern tendency to discard people seen as inconvenient. The Democratic elite even rejects conscience protections for medical practitioners who object to abortion. Opposition to taxpayer-funded abortions, once acceptable, has become taboo.

The straw that broke this camel’s back was Pete Buttigieg’s extremism. Here was a mainstream Democratic candidate suggesting, at one point, that abortion is OK up to the point the baby draws her first breath.

When I heard that, I realized we were fighting a losing battle.

If the party was willing to go all-in on the most volatile issue of our time with a position held by only 13 percent of the population, it was time to take no for an answer.

Many find it difficult to understand how a single issue could be so motivating for so many millions of people. If that’s you, put abortion out of your mind for the moment and consider the following thought experiment.

Suppose that hundreds of thousands of children are being killed each year in horrific ways. Often they are killed because they have Down syndrome. Sometimes, it is because their grandparents thought their parents were too young and irresponsible to have a child. Very often, it is because an abusive partner demands that the child be killed on threat of violence.

And then suppose a political party claimed this killing was a ­social good. Just another kind of health care. Something to shout about with pride.

This party, it should go without saying, would be unsupportable.

Then keep in mind pro-lifers rightly see no moral distinction between a living human child at seven weeks gestation with a four-chambered heart pumping blood, a prenatal child at 20 weeks gestation who, we now know, can almost certainly feel pain, and older children who have already been born.

Then do the math. The reasoning should be clear.

My broader values mean I can’t vote Republican, however, and this makes me one of many millions of Americans for whom our political duopoly doesn’t work.

I decided to play the long game by joining the American Solidarity Party, a small but growing group that refuses to compromise on support for women, protection for prenatal children and solidarity for working people and the poor and vulnerable.

But millions of others who don’t share my broader values will ­reluctantly feel forced to check the box for a Republican in ­November. And Democrats will have no one to blame but their own extremism.

Charles Camosy is associate professor of theological and social ethics at Fordham University and author of the new book “Resisting Throwaway Culture.” Twitter: @CCamosy