PARIS—The French Parliament passed a bill on Friday that aims to strengthen government oversight of mosques and other religious organizations and counter the influence of Islamist movements that French President Emmanuel Macron says are undermining the country’s secular values.

The legislation, called the Law Reinforcing Respect of the Principles of the Republic, passed the National Assembly, or lower house of Parliament, with a vote of 49-19, garnering support from lawmakers in Mr. Macron’s ranks as well as other centrist parties.

Mr. Macron and his supporters in the legislature have framed the bill as a response to the spread of Islamist separatism, which the president describes as a political and religious project to create a parallel society where religious laws take precedence over civil ones.

That ideology, the Macron government says, undermines the values of the French Republic—liberty, equality and fraternity—as well as the principle of laïcité, France’s strict separation of religion and state.

The bill bans practices such as forced marriage that the government says are fueled by the separatist ideology.

Religious leaders say the government’s push oversteps the religion-state divide created under a landmark 1905 law. That act forged the principle of laïcité by barring religious groups from receiving state aid, with few exceptions, and excluding clergy from government posts. It also established freedom of conscience and freedom to practice religion, within the bounds of “public order.”

The new law empowers the government to permanently close houses of worship and dissolve religious organizations, without a court order, if it finds that any of their members are provoking violence or inciting hatred. It also allows temporary closure of any religious group that spreads ideas that incite hatred or violence.

French President Emmanuel Macron attended the opening ceremony of the Tokyo Olympic Games Friday.

French President Emmanuel Macron attended the opening ceremony of the Tokyo Olympic Games Friday.

Photo: dylan martinez/Agence France-Presse/Getty Images

Religious organizations will have to obtain government permits every five years to continue operating, and have their accounts certified annually if they receive foreign funding.

In addition, the new law makes it a criminal offense for anyone, in the name of ideology or religious extremism, to put pressure on civil servants and public-service providers to deviate from France’s secular values. Under its provisions, a man who refuses to allow a male doctor to examine his wife could face up to five years in jail and a fine of up to €75,000.

France’s conservative party Les Républicains voted against the bill, saying it didn’t do enough to address the problem. Socialists and France Unbowed, a far-left party, also opposed it, saying the bill gave the government too much power over civic and religious groups.

“With this text, we have gained nothing and lost freedoms,” said Alain David, a Socialist lawmaker.

The vote comes on the heels of a string of terrorist attacks in France that have torn at the seams of French society, particularly about the role the educational system is supposed to play in molding the children of French Muslims into citizens of a secular republic.

In October, middle-school teacher Samuel Paty was beheaded in a terrorist attack after the father of one of his students posted a video online complaining about the teacher’s decision to display cartoons of the Prophet Muhammad to his class as part of a civics lesson. The attacker, an 18-year-old Chechen refugee, acted after seeing the video, according to authorities.

Two weeks later, a Tunisian man killed three people in a knife attack at a church in the Riviera city of Nice.

Under the bill’s provisions, the unauthorized posting of someone’s personal details online to expose them to harm is punishable with a fine of €45,000 and up to three years in jail.

Protesters demonstrated against the bill in March. Some French politicians said it gave the government too much power.

Protesters demonstrated against the bill in March. Some French politicians said it gave the government too much power.

Photo: alain jocard/Agence France-Presse/Getty Images

French authorities launched a sweeping crackdown in the wake of the terrorist attacks, forcing the closure of some Islamic schools and starting investigations into dozens of mosques.

Authorities ordered the temporary closure of a dozen mosques and associations including the Collective Against Islamophobia in France or CCIF, a group that provides legal representation to Muslims who say they have suffered discrimination because of their faith.

Lawmakers at the National Assembly didn’t include some of the amendments the French Senate sought to add, notably provisions barring school field-trip chaperones from wearing overt religious symbols, and banning burkinis in public swimming pools.

The law passed Friday also requires parents who home-school their children to obtain authorization from the government, a provision aimed at ensuring children are taught France’s secular values. The Senate sought to strike that measure, but the National Assembly refused.

In France, lawmakers at the National Assembly have the final say in case they disagree with the Senate.

The law prohibits forced marriage or the practice among some Muslim families of requiring women to undergo a medical examination to check their virginity before they can marry.

It also extends an existing ban on civil servants displaying conspicuous religious symbols on the job. The ban will now also apply to employees who provide a public service like transportation, even if they aren’t directly employed by the government.

Write to Noemie Bisserbe at noemie.bisserbe@wsj.com and Matthew Dalton at Matthew.Dalton@wsj.com