Harkening back to the days of tithing, when Jews (and evidence shows also the Babylonians and Ugarit) would set aside one-tenth of what they had, had earned, or had taken in (there were varying definitions), this question prompts us to look at the contributions which support our religious goings-on.
We might, as some do, refer to Genesis 14:18-20, in which Avram gave the King of Salem 1/10 of everything. But then, the King said he would rather have the persons and not the things. That speaks rather more to decimation than to charitable giving.
In Genesis 28:12-22, we see Jacob promising to “repay” God one-tenth of what He gives to Jacob.
In the times of the First Temple, the first tenth of agricultural produce was given to the Levi’im, who made certain it would sustain them and the Kohanim (the priestly class). During the Second Temple, the Kohanim began collecting certain amounts directly. Some say that soon after that, charitable donations began being handed over into a collection plate during services, which might make Jews the first to "pass the hat" to support the institution.
During the first century BCE, when Herod was reconstructing the Temple and building platforms for the surrounding area, he instituted a tax to support the building (according to Josephus, as reported online). Since that time (and probably before it, too), many governments have instituted taxes to support religious institutions, based on their providing for the “common good.”
I suppose you expected me to answer the question simply, “Because we are not allowed to carry money on Shabbat.” That is, of course, true, the rabbis have forbidden the carrying of money, lest we be tempted to do commerce on Shabbat. But – in addition to paying dues to our religious institutions – we do pass the pushke (the collection tin) at weekday morning minyan and other times, because every bit helps support our goings-on and the greater community.