A free transfer is a move in which no fee is paid to the selling club, because the player's contract has expired or been cancelled. It is not free to the buying club: wages, signing-on fees and agent commission still apply, and are often higher precisely because no fee is due.
The money does not disappear, it moves. With nothing owed to the selling club, the player and their representatives are negotiating for a share of what a fee would have been, which usually appears as a large signing-on payment, a high wage or both.
Free transfers also carry a hidden accounting cost. There is no fee to spread across the contract, so nothing is amortised, but the full wage bill lands in the accounts every year, and there is no book value to sell on later if the signing does not work.
For selling clubs the risk is the reverse. Letting a valuable player reach the end of a contract converts an asset into nothing, so clubs facing a final year will often accept a reduced fee rather than keep a player whose value they cannot replace.