Judge Marina Syrova convicted the women of hooliganism motivated by religious hatred, saying they had “crudely undermined social order”.
The women say the protest, in February, was directed at the Russian Orthodox Church leader’s support for Vladimir Putin.
The US, UK and EU all criticized the sentences as “disproportionate”.
Prosecutors had been seeking a three-year jail sentence for the women.
Judge Marina Syrova said Maria Alyokhina, 24, Nadezhda Tolokonnikova, 22, and Yekaterina Samutsevich, 29, had offended the feelings of Orthodox believers and shown a “complete lack of respect”.
“Tolokonnikova, Alyokhina and Samutsevich committed hooliganism – in other words, a grave violation of public order,” Judge Marina Syrova said.
Along with other members of their band, the women staged a flashmob-style performance of their song close to the altar in the cathedral on 21 February.
Their brief, obscenity-laced performance, which implored the Virgin Mary to “throw Putin out”, enraged the Orthodox Church – its leader Patriarch Kirill said it amounted to blasphemy.
Vladimir Putin was elected for a third term as president two weeks later.
Maria Alyokhina, Nadezhda Tolokonnikova and Yekaterina Samutsevich, watching Friday’s proceedings from inside a glass-walled cage in the courtroom, smiled as the widely predicted conviction was announced.
The judge then took three hours to read the verdict, before handing down “two years deprivation of liberty in a penal colony” for each defendant.
“Considering the nature and degree of the danger posed by what was done, the defendants’ correction is possible only through an actual punishment,” Judge Marina Surova said.
One man in the courtroom shouted “shame” at the sentencing, and there were chants and whistles from the band’s supporters outside.
Nadezdha Tolokonnikova’s husband, Pyotr Verzilov, said: “Russia’s image was quite scary even before [this]. What happened now is a clear sign that Russia is moving towards becoming more like China or North Korea.”
Opposition leader Alexei Navalny added: “They are in jail because it is Putin’s personal revenge. This verdict was written by Vladimir Putin.”
The defendants’ lawyer, Nikolai Polozov, said they would not appeal to President Vladimir Putin for a pardon. However, there will be a legal appeal against the verdict.
Amnesty International said the ruling was a “bitter blow” for freedom of expression in Russia.
EU foreign affairs chief Catherine Ashton and the UK’s Foreign Office criticized the severity of the sentences.
US state department spokeswoman Victoria Nuland said: “We urge Russian authorities to review this case and ensure that the right to freedom of expression is upheld.”
On Thursday, Nadezdha Tolokonnikova had said she was “not bitter about being in jail”. But, speaking through her lawyer on Twitter, she said: “Politically, I am furious.”
“Our imprisonment serves as a clear and unambiguous sign that freedom is being taken away from the entire country,” she said.
The women have been detained for the past five months.
Associated Press news agency said a number of protesters had been arrested outside the court before the sentencing was announced, including ex-world chess champion Garry Kasparov and opposition politician Sergei Udaltsov.
There were also pro-Pussy Riot protests in Paris, where demonstrators in Igor Stravinsky square chanted “Freedom”, and in Kiev, where women protesters sawed down a wooden cross in a central square.
Other shows of support took place in Belgrade, Berlin, Sofia, London, Dublin and Barcelona.
The band has also had vocal support from artists including Paul McCartney and Madonna, and from politicians.
Critics of the band have also been demonstrating, saying the stunt was an insult to the Russian Orthodox Church.
Igor Kim from Moscow said: “Shouting and screaming and spreading hate in Church is unacceptable and is contrary with Christian ethics.”
Valentina Ivanova, a retired doctor, told Reuters: “What they did showed disrespect towards everything, and towards believers first of all.”
One protester outside court in Moscow simply shouted: “Let Pussy Riot and all their supporters burn in hell.”
4OZS1U6zM_oThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…