I don't see how being an atheist means someone lacks the ability to recognize ideology. Religion may help because it gives practice putting boundaries on ideas which are obviously ridiculous. You can't go around pushing everyone to follow Deuteronomy for very long
Overall these pitfalls can be avoided by following some principles: reject taboos, seek more information, avoid metaphor, accept that some things you can't know
Atheism also doesn't guarantee that one does recognise ideology.
OP is correct. Religion is a subset of ideology, and not being religious does not in any sense guarantee that one isn't trapped inside an ideological frame.
But OP is wrong to suggest religion is a cure for this, or even a workable substitute.
Ideological thinking is a template - a kind of psychological design pattern. It may well be innate, and can only be sidestepped by learning a different set of philosophical habits.
Collectively, we don't have that. Neither critical thinking nor science do the job. They do other useful jobs, but teaching how to avoid tribal identification among followers and competitive authoritarian individualism among leaders - the real core of all ideologies - isn't something they're designed for.
Overall these pitfalls can be avoided by following some principles: reject taboos, seek more information, avoid metaphor, accept that some things you can't know