I see from a similar question that in the US and Canada wire transfer are even more expensive than in Europe where I live. But I am interested in the situation in Europe even though their cost is strange even outside Europe, after all they use the same infrastructure used by all the other payment systems.
In order to send a wire transfer, the money backing it must be available at the sending bank's account at their respective national central banks. That would be a branch of the US Federal Reserve for US Dollars, and a national bank member of the European Central Bank for Euros.
In essence, a wire transfer is an immediate adjustment on the books of the central bank. SWIFT is a "messaging system" over which banks communicate what adjustments to make but does not actually move money.
Banks must have a positive balance by the end of the day, or else they must borrow cash at relatively high interest rates. In contrast, credit cards, ACH/SEPA payments, debit networks, etc. have a minimum 24 hour clearing cycle, thus the bank has at least a day to come up with the money, e.g. by selling investments or holding on to more cash from a previous day.
The US Federal Reserve is paying 0.10% interest, which is tiny versus other investments. Worse, the European Central Bank's deposit interest rate is currently -0.50%. They charge banks 1/2 percent to keep that money around.
In the US, there is a significant opportunity cost to having that cash immediately available, in the Eurozone, there is an actual cash cost. In both cases, the costs are charged back to the customers who use telegraphic transfers as expensive fees.