I agree with you that "raised the cost of" definitely sounds wrong. I'd argue it's not correct usage from a logical perspective and not a grammatical one. "Raised the cost of mistreating allies" could definitely make sense in another context.
Consider a fictional country where the leader has a policy of mistreating allies and has a budget for doing so. If one of their policies included sending passive aggressive letters to leaders of their allies and the price of paper went up, this would "raise the cost of mistreating allies." Of course, this is kind of nonsense, but hopefully it illustrates the point that this phrase could be used correctly in another context.
As for your suggested replacement, I'd say it still doesn't quite fit. "Come at the cost of" is usually followed by a negative side effect incurred by someone. Consider:
Automation in the auto industry has led to drastic reduction in manufacturing costs but has come at the cost of manual labor jobs.
Here, it is implied that the (negative) side effect of automation is the loss of manual labor jobs (people get fired). In your source quote, it seems like the author is arguing that "mistreating allies" is the main effect of "Mr. Trump's decision," not a side effect of it.
If I were to rewrite the above quote to make a similar logical argument to your source quote, I might (nonsensically) say:
Laying off manual workers in the auto industry has already come at the cost of firing workers.
This is perhaps a bit strange, but hopefully illustrates that this incorrect usage is trying to equate two things (and in doing so, saying the same thing twice). The correct usage should show a side effect. And importantly, the side effect should be suffered by someone (ex. "people getting fired") and not an action being equated with the subject of the sentence (ex. equating "Mr. Trump's decision" to "mistreating allies").
So, extrapolating from the opinion of the author, what would be a better replacement? Any of the following would work (whether or not they are true, however, is something I won't breach!):
Mr. Trump's decision to withdraw from the Iran nuclear deal and levy metal tariffs on Canada and the Europeans has already come at the cost of strained relations with close allies.
Or retaining the original usage:
Mr. Trump's decision to withdraw from the Iran nuclear deal and levy metal tariffs on Canada and the Europeans has already raised the cost of goods and services for American consumers.
Also as a minor note: I changed "metals tariffs" to "metal tariffs," because the singular is preferred in US English. UK English may differ, though, like they do with math/maths.