Killing a mid ranking diplomat when he was on a diplomatic mission is a breach of international law, and seems to have gained the disapproval of most countries in the world. It doesn't seem to have much benefit for the US either. It has pushed Iraq into the arms of Iran, and increased the influence of China and Russia in the area. It will also mean that the US won't get a look in when the new Iranian oil field is developed.
Another side effect is that the retaliation shows that Iran is able to send ballistic missiles onto precise targets, and the US does not have an effective defence system against them. The US could never defeat Iran, because the country is too large and mountainous, and it would never be able to occupy the country. Iran also has a very sophisticated cyber attack facility, and the US is vulnerable to this.
It seems that Washington has only one possible off-ramp at the moment, and that is to withdraw all its troops from Iran and Iraq, and this will weaken its influence in the Middle East.