Where else can you take him out though? There's no perfect place but of all the places in that region, Iraq is where Solemaini caused the deaths of so many people and its where he was meeting with militia leaders, possibly to carry out more.
I think there's a broader question of whether the assassination was the right thing to do at this particular time but if you accept that it is then given the number of high-value military targets who were also killed in a country that the US military had been invited to fight in (maybe not in these circumstances) then in many ways, it was the perfect attack.