No one really knows why, but the Oxford Dictionary of Idioms and Oxford Dictionary of Word Origins offer the suggestion that it is related to religious restrictions on activities on Sunday.
Many people seem to have taken hold of an often-repeated (on blogs, forums, and such) claim that this "literally" means either 7 weeks or 30 weeks. I can accept that some people use the expression that way, because, hey, it's an expression, but I'm at a loss to see how people are painting that as "literal", because literally a month is 28, 30, or 31 days and has 4 or 5 Sundays. "A month" isn't a generic container word for 30 of something, and "a Sunday" isn't a literal word for "a seven-day period".
Many of the answers seem to imply some dictionary authority for this as "literal". It's true that dictionary.com says the above, but it's pretty short with no explanation or references of its own. The Oxford Dictionary of Idioms says:
a month of Sundays a very long, seemingly endless period of time
This expression may be a reference to the traditionally slow passage of Sundays as a result of religious restrictions on activity or entertainment. In a letter written in 1849, G. E. Jewsbury talked of the absence of mail deliveries on Sundays, remarking: 'If I don't get a better letter from you ... you may pass "a month of Sundays" at breakfast without any letter from me'.
Similarly, the Oxford Dictionary of Word Origins says:
Where Christianity was the dominant religion, restrictions on pleasure and activity meant that Sundays were quiet, private days. This may be behind the expression a month of Sundays, 'a very long, seemingly endless period of time'. The expression is known from 1836 in The Clockmaker by Thomas Chandler Haliburton: 'Mr. Slick ... told him all the little girls there would fall in love with him, for they didn't see such a beautiful face once in a month of Sundays.'
Neither of these try to stretch the phrase into some sort of arithmetical equation. The literal interpretation that makes sense of the words is "a month [comprised] of [only] Sundays" — which of course is also nonsensical, but at least it's actually literal. But of course, it's an idiom, so the literal meaning is only slightly helpful in the first place — the "why" is going to be in the figurative meaning, and for that it seems we can only guess.
The explaination the Oxford dictionaries offer, "Sundays are long and without activity, so a whole month of those feels like a lot", seems logical enough.