Christians, and other religious people, just spout this mantra because they assumed it was true (like every other part of their theology) based upon their prior assumption of the bible and their gullibility ('hungry ears'). A pastor, preacher, minister, or father figure preached it from the proverbial pulpit (or the actual one) and they bought it - not because they thought about it and actually did some homework but because they believe what they do in order to feel comfortable and important, and anything toward that end is beneficial in their eyes. Thus, they have no problem accepting what their pastor says on Sundays (as my dad often does, and often quotes) because it caters to their intuitions, desires, and psychological cravings.
The assertion that without God life has no meaning is meaningless itself. It assumes there must be "cosmic meaning" in order for life to have any meaning while also assuming that the term "meaning" applies to only that which is 'eternal'. This faulty thinking ought to be resisted through and through by anyone who cares about truth.