Paul McCartney wrote this song. It was inspired by his mother, Mary, who died when he was 14. Many people thought "Mother Mary" was a biblical reference when they heard it. Since Let It Be was The Beatles last album, it made an appropriate statement about leaving problems behind and moving on in life.
Thank you. I remember at the time there was moral watchdogs claiming "Mother Mary" was a reference to Marijuana, and demanding the song should be banned.