Your question is based on false presumption - religion was never banned in USSR. Per Constitution, citizens were entitled to the freedom of expression and thoughts, which included religious practices as well (see [1,2]):
March 12, 2012. The Washington Post columnist E.J. Dionne quotes Cardinal Francis George, archbishop of Chicago, describing worship in the Soviet Union. Cardinal George:
Freedom of worship was guaranteed in the Constitution of the former Soviet Union. You could go to church, if you could find one. The church, however, could do nothing except conduct religious rites in places of worship – no schools, religious publications, health care institutions, organized charity, ministry for justice and the works of mercy that flow naturally from a living faith. All of these were co-opted by the government.
Here's quote about religious freedom and separation of state from church, article 124, Constitution of USSR (1936 ed.)
(russian)
Статья 124. В целях обеспечения за гражданами свободы совести церковь в СССР отделена от государства и школа от церкви. Свобода отправления религиозных культов и свобода антирелигиозной пропаганды признается за всеми гражданами.
In reality there were periods when clergy was persecuted. Note that most severe period of persecution happened before USSR formation and it had political reasons. Orthodox Christianity was a state religion in Imperial Russia and therefore clergy was pretty strong and participated in many state activities - like keeping civil records for marriage and birth, teaching mandatory lessons at school etc. Church was reach, powerful and owned a lot of land, Cathedrals were in prime spots in cities. Bolsheviks proclaimed a separation between Church and State in their first decrees - see [3].
After Bolsheviks took power, top Orthodox clergy did not support new regime (which took away many privileges and perks of state religion). It quickly went from subtle discontent to active resistance - many prominent clerics put anathema on "godless bolsheviks" and actively supported Whites in Civil War - by funding and agitating against Bolsheviks. In turn, Reds often looted churches and killed clerics in effort to diminish church influence over local populace. In rare instances field commanders were reprimanded by higher-ups for "excesses against clergy" as it fueled anti-bolshevism in peasantry. But that was prior to USSR formation.
Then in 20s state launched a campaign, meant to diminish "soft power" of clergy. Using lack of food as pretext, many churches were looted, so jewelry could be sold. Many churches in prime spots were destroyed or confiscated for state use.
There was strong state propaganda against all religious confessions. It was based on theory that Marxism philosophy proves primacy of material world over world of ideas, since material human brain generates ideas and not the other way around etc. Therefore, all sort of religion beliefs were declared nothing but superstitions to help a ruling class to hold workers and peasants in submission - thus famous motto "religion is opium for masses". This is very rough and short description of the dialectical materialism.
Strong state propaganda and discrimination against believers (no career growth for openly religious) decimated power base of church to a point when religion was considered to be "for old people" and "harmless" to the state.
Last push against religion happened in 30s - with hunger in Volga, Ukraine, Kuban' and Kazakhstan. Most of grand cathedrals, still lingering around were either destroyed or confiscated, their riches looted and religious services pushed to city outskirts, away from spotlight.
After Germany invaded in 1941, church enjoyed mild resurgence. Mitropolit Sergiy wrote address to believers almost immediately and on his own, without any consultation with state. Under other circumstances it might have caused repercussions and considered as meddling into state affairs, but was viewed favorably. Clergy collected donations for building tanks and airplanes and such facts were widely publicized. High-ranking clerics even participated in demonstration of support to the army, broadcasted over radio. Stalin met with Moscow Patriarch in august of 1943 and endorsed some easing in state policies toward religion - restored Moscow patriarchy, allowed building of new churches.
After war ended, practicing religion was not encouraged, and practitioners were considered to be "backward", but mostly left to their own devices. Short anti-religion campaign happened from time to time - for example, in 70s when orthodox christianity started to gain in popularity.
PS. Some sects, considered to be "harmful for mental health" were banned - like Jehovah witnesses, adventists etc. - but those weren't too numerous.
Sources
Religion in Russia and the Soviet Union, to 1945. Brief outline in English.
(russian) Wiki page on history of religion in USSR. Article of decent quality and gives more details, than [1].
(russian) Decree about separation of Church from State and School from Church. Prohibited religious lessons at schools, among other things.
(russian) S. L. Firsov - History of Moscow Patriarchy restoration in 1943. Short article by professor of history from St Petersburg University. Interesting photo of clergy under Stalin's portrait.
Religious Policy in the Soviet Union - collection of articles, 2005. Scholarly study, published by Cambridge press.