Justice Minister Judith Collins told Parliament this was outdated and could no longer be justified.
"It is important that our constitutional institutions such as the monarch retain ... their history and tradition. But it is also important that the rules that govern these institutions evolve to reflect the times in which we live."
The bill will also remove the restriction which bars a person who is married to a Catholic from the throne. However, the legislation will not allow a Catholic to become monarch - a new king or queen will still have to swear an oath to the Anglican religion.
The bill was ridiculed by Opposition MPs, Labour's Sue Moroney saying it made "archaic laws a little less archaic".
Labour Party justice spokesman Andrew Little said his party would support it, but Parliament was wasting its time on an "anachronistic" law change.
"Who would have thought that in this day and age that we would be legislating ... to overcome prejudice against Catholics?"
Green MP Kennedy Graham said the legislation was an "undeniable" breach of the human right to freedom of religion.
His party abstained from voting on the bill's progress.
The changes will apply to all royal births after October 28, 2011.
Mrs Collins said it will apply to the child of Prince William and wife Catherine, who are expecting their first child this month.
The child will be the third in line to the throne.