Why did Europe become less religious?

by nun3856

This is in regards to Western Europe. For example Ireland, who was once regarded as one of the most Catholic countries in the world just 40 years ago just passed same sex marriage by a referendum and Spain who was also extremely religious not too long ago is also less religious.

What made Europe become less religious while regions like Africa/Middle East continue to maintain a consistent following of faith?

Searocksandtrees

Mod note: Since this question is about fairly recent history, and a topic with which many people have personal experience, just a reminder of a few rules of this subreddit.

In /r/AskHistorians, we're looking for in-depth responses from subject experts, backed by solid source material. As such, comments consisting of anecdotes, conjecture, opinion are not permitted. Additionally, all responses must respect the subreddit's "20-year rule" against current events: keep all discussion to events/conditions pre-1995 only. For a full review of the rules, please see here.

Thanks all!