The news that parents are still scrabbling to secure primary-school places for their children fills me with profound sympathy. Well, no, that's not exactly true. What it actually fills me with is profound relief that my own daughter is due to attend the lovely Church of England state primary across the road in September. But my relief – all right, my smugness – is mingled with my guilt over how my partner and I nabbed that precious school place. Yes, you guessed it. We had our daughter baptised. Even though I'm an atheist of the Dawkins-for-prime-minister variety, I promised to renounce the devil and steer my daughter towards the pearly gates.

It was an infuriating decision. The school is so close to our house that if I lobbed my copy of God Is Not Great out of the bedroom window it would land in the playground. But in the school's "oversubscription criteria", proximity lies in a lowly sixth place. Above it, in descending order, are being in care, going to the parish church, being a practising Anglican, being a practising Christian, and being a baptised Christian.

It is a mind-boggling, somewhat sinister list to read. And it doesn't seem to have much to do with what church schools were set up for, back when there was no such thing as a comprehensive system, and when pretty much everyone in England identified themselves as Anglican. In the 21st century, when we have taxes rather than tithes to pay for education, and when a quarter of us tick the "No religion" box on the census form, it's strange that we haven't scrubbed something as divisive as theology from school admission policies. Just think of the social-cohesion benefits that might follow. Instead of instructing our youngest and most impressionable citizens to separate themselves along religious lines, we could be spending five days a week teaching them what they have in common.

Download the new Independent Premium app Sharing the full story, not just the headlines

Nonetheless, even the most heathenish of us view faith schools with amused resignation. We echo Alexander Armstrong's catchphrase in BBC2's Rev: "On your knees, avoid the fees." But all of us, devout or doubting, should be outraged by unfair discrimination wherever we see it. As opinionated as my daughter is on the questions of ice-cream consumption and cartoon watching, she has no more influence over her religion than she does over her skin colour, so why should it have any more of an impact on her education? If a school hired Nick Griffin to sort out its over-subscription problems, we might not chuckle so indulgently.

The topic always reminds me of my grandfather's uncertainty, in the 1970s, about whether to allow a Jew to join his golf club. It wasn't that he had anything against Jews, he said. It was just that if you let one in, they would all start joining, wouldn't they? That was a long time ago, and my grandfather was already an old man, and yet, nearly four decades on, we continue to fund schools with a comparable outlook: they've got nothing against Jews/Muslims/Protestants/Roman Catholics/atheists, they assure us; it's just that they want them to go to the back of the queue. Shouldn't we be appalled by this? Or do we think that primary schools matter less than golf clubs?

Defenders of faith schools don't tend to concern themselves with such ethical niceties. I've read numerous apologias in newspapers over the years, but they all come down to the same central thesis: "My own children go to a faith school, and it's excellent, so that's all right." Conveniently, the writers of these pieces invariably belong to the same religions as the schools they're talking about. Whether they'd be so complacent if they worshipped a different deity is never discussed. And they never acknowledge that it's exclusivity, not godliness, that gives these schools their edge.

Imagine if a school prioritised families who went to a museum or a park every Sunday. Imagine if parents had to bring in a slip signed by their tennis instructor certifying that they practised their cross-court backhand at least three times a month. In both cases, the school would be favouring those parents who were willing to jump through hoops for the sake of education. And those parents' children, in turn, would be more motivated than the pupils in the catholic-with-a-small-c school down the street. You can bet that a pro-museum or pro-tennis academy would soon be as high up the league tables as any rival with a crucifix or a star of David on its uniform. But, of course, we'd never permit a school to set such conditions. As in so many areas of modern British life, there's one rule for the religious and another for the secular. If only some schools were biased towards non-believers, I might not be gnashing my teeth quite so hard.

Not that any of this stopped me going ahead with the baptism, mind you. By now, a fair number of readers, both religious and secular, will have me down as a deplorable hypocrite. To the former group, I'll quote Bill Hicks: "So forgive me." I'll also add that thousands of atheists go through the same charade every year, many of them slumping in pews, week after week, just to "prove" that they're Christian. It's been standard procedure since the 1980s, when "parental choice" turned school-hunting into a competitive sport. I accept that this is no excuse. When I shoved aside the Buddhists and Wiccans who may have applied to the same school as us, I knew I was doing something wrong. But here, for what it's worth, is how I let myself off the hook.

My principal argument is that because we live so close to the school, our daughter should have been a shoo-in, anyway. Having her baptised was merely our way of beating an unjust system. And for my part, the decision was made easier, not harder by my atheism. If I had a shred of spirituality I might have been conflicted about standing in a church and taking the Lord's name in vain. But because I saw the whole ceremony as beautifully poetic hokum, participating in the ritual didn't seem any weirder than visiting Santa's grotto in a department store, or shouting, "I believe in fairies," during a production of Peter Pan. We all tell the odd white lie to keep our children happy.

But there's another reason why I don't feel too bad about the baptism, and it brings us to the unlikely hero of this story: the vicar. It was his suggestion that we have our daughter dunked in the font. When I objected that, as a church-dodging sceptic, I wasn't comfortable with the idea, he floored me with his reply. "You don't have to see it as religious if you don't want to," he said. "When I was younger, everyone got baptised; it didn't matter if their families went to church or not. You can just see it as a traditional way of welcoming your daughter into the community." I had my diary out 10 seconds later.

A couple of months after that, everything was sorted. My daughter was the centre of attention for the day, I relaxed about where she would be learning her phonics in September, and the vicar, having been Christian in the best possible sense, saved her soul from damnation. All's well that ends well. But it still felt as if we had taken a trip back to an earlier, less enlightened era. Shouldn't a little girl be able to cross the road to school without all that rigmarole first?