And it's not so much that the expendables are "fungible". By definition, they are not, and it's technically illegal to perform this sort of back-dating. It's just not easily verifiable that such a thing has happened.
If the department decided to do a one-off like "t-shirts for the programming team" and put it into the budget, it's highly likely there isn't already a restricted fund of any type that would cover such a thing. If they got the budget approval for it, it'd almost certainly come out of the unrestricted fund. But then you come along, not knowing that the department has planned on doing this, remembering fondly your days on the programming team, thinking "it would have been really nice if we had matching t-shirts for when we traveled to competitions", and you come up with the idea to give an expandable gift, but you end up giving it after the t-shirts have already been bought.
This sort of serendipity is common enough, for a variety of different things. The correct thing to do would be to send the money back to you, because the money is already spent, they can't unspend the unrestricted money, but they aren't likely to agree to do a second t-shirt run. But it's highly unlikely you'd learn otherwise, or even care if you did, so they whitewash over the issue because there is almost zero chance you're going to find out that there was a budget amendment saying the t-shirts weren't purchased until after your gift, even if the students have had them for weeks already.
And I personally know of plenty of places that will do just that, not tell the little white lie and actually return the gift. They have a standard of ethics they adhere to and rightly view it as a slippery slope. It's a short hop from this sort of thing to, say, back-dating donations given after the first of the year to say they were given before the first of the year so donors can claim them on their taxes, putting you into the realm of full-blown tax fraud.
But yes, unrestricted funds are, by definition, completely fungible. Often, you'll be donating in response to a "solicitation" tied to a specific "campaign", e.g. a mailing as part of a specific project to generate a certain amount of money. They'd likely be asking you to donate towards "the so-and-so endowment for the arts", or some other named fund. This is just a form of salesmanship, structuring things in this way, supposedly people are more willing to donate money when it's to a specific, named cause [0]. If you really care about your organization, you should write in a note that you wish to donate to the unrestricted fund, or to use the funds "as deemed fit by the university/hospital/etc".
[0] I somewhat doubt anyone has actually done a study, and even if they did, I severely doubt it was conducted properly to show significant results. This isn't exactly a field full of statistics professionals.