How exactly was the US benefiting in this arrangement? Sounds very one sided if the American tax payer is doing the bulk of spending while Europe is freeloading
The US has allies in return for this spending. A block of people who stand against autocrats and with the US.
It also bought a much more peaceful and free world. Not just nice because it is better for people, but also because it gives opportunity for trade.
Note that it might have been possible for the US to convince the rest of NATO to spend more on their defense without losing the faith of their allies. This sure isn't the way to do it.