Another way to do it is to provide for a certain percentage of "overhead" costs, as with e.g. NIH grants. So if for every $10 that goes to Professor X, $6 goes to the university to use as they please, they can't then fire Professor X without losing the extra $6 as well. (Naturally this only works with relatively larger amounts of money.)
Even with more transparent reporting, it'd still be possible in some cases to hide where the money is really going. There could have already been a planned budget increase, for example.
Ultimately it just comes down to trust. If I don't trust the wider institution, I will not donate to a subsidiary. And with more and more schools operating like businesses these days, it's hard to know who to trust.
It's important to consider that academic departments are separate from finance offices, which themselves are also separate from development offices. The finance office determines how much money every academic department will receive, then turns around and tells the development office they need to raise that much money. That number is usually "however much we think you can realistically raise, plus 10-20%", in typical MBA asshat fashion. Of course, they set the budget based on that number, so at the end of the year either the development office has gone above and beyond and actually raised all that extra money, or there are last minute budget cuts (which is the typical outcome).
Usually, if a person were to restrict a gift for a certain purpose, it will have to either go towards an existing endowment for that purpose, or have a new endowment created for it. This is usually stuff like "scholarship with donor's name on it". If the endowment already exists, the money is pretty much guaranteed to get disbursed towards that endowment. If it's a new endowment, the board of directors usually has a set limit on the minimum amount of money necessary to create a new endowment. Anything less than that will just be refused, usually with a sales pitch to try to get it sent to the fungible, unrestricted fund instead. They really don't like to give up money.
Anything that is a budgetary line item will first get funded by any restricted gifts that meet their requirements. If there is an endowment specifically for "maintenance of such-and-such building", then maintenance is first drawn from that pool. Any shortfall thereafter gets filled by the unrestricted funds. You can make gifts towards "expendables". They are earmarked for very specific things like "new jerseys for the football team". If they're for things that aren't on the budget already, then department gets to choose whether or not to spend that money. If they don't, they have to give it back.
So you are correct, theoretically a restricted gift does not increase the department's or a specific professor's budget. But so many gifts are restricted in so many ways that some issues are overfunded, leaving others to be underfunded. For example, if too many people are giving money "for the music program", more than the music program can spend, then they can't turn around and apply it to the general "art department" in which the music program sits.
If the organization spends the money inappropriately, it's majorly bad news. IRS audits, criminal proceedings, someone is going to jail. If they can't spend the money given to them, they will try to contact the donor and get them to change their mind on the restriction. If the donor is particularly set in their mind, they will return the gift.
But there is a grey area in the middle. If something in the recent past had been covered by unrestricted money that could be covered by a newly collected restricted gift, then someone might hand-waive and retroactively say the restricted gift had been used on that issue and suddenly there is magically more money in the unrestricted pool, which just so happens to coincide with the amount of the restricted gift.
This is illegal, but it falls on the donor to prove it happened. If their issue got funded, then they won't have any way to suspect anything is going on.
So, in the specific example of trying to use restricted gifts to keep Mr. Coward's job: the very most likely thing to happen will be that the development office will refuse the gift, because they will probably assume the finance office will refuse to disburse the gift, because the finance office will probably assume the department will refuse to spend the money. If somehow it got past development and finance, the department will just give the money back.
If such a gift marked as "for Mr. Coward's salary" were spent, yet they still fired Mr. Coward, the university doesn't necessarily have to report to the public the nitty-gritty details of their spending, and there are certainly ways they could make things look good on any publications that did go out, but this particular example makes for a situation in which individuals could easily check up through outside channels. The donor who gave the gift would merely have to call Mr. Coward up and ask "hey, do you still have a job?" and receiving they answer "no", they'd have a really good reason for asking for an investigation into the institution's accounting.
So donations marked for expendables such as pizza or classroom costs are easily fungible. It is a one off cost that won't be compared year over year.
Interesting viewpoint that small earmarked donations toward non-expendables such as salaries are viewed as time bombs. Sounds to me like acquiring fungible funds is pretty common and a major goal of finance and development offices. That is, they want to encourage people to give unrestricted money. They don't want donations from people who don't trust the organization as a whole. Sounds reasonable.