The American airstrikes last night took 5 days for a response and Iraq was informed of the strikes in advance.
This implies that the Iranians and their allies were aware of the locations of the strikes and had enough time to move away from the targeted areas. Ultimately, it boils down to interests and priorities, and there are individuals who advocate for this approach.
https://twitter.com/fmnsouli/status/1753662980468719819
Iran, its partners in Iraq, and the Iraqi government falsely claimed that the strikes were violations of Iraqi sovereignty.[12] Western media outlets reported that Iranian-backed Iraqi militia Kataib Hezbollah launched the attack from Rutba, Anbar province, western Iraq.[13] The United States has the right to respond and defend itself against these attacks from Iranian-backed groups in Iraq. Iranian-backed groups in Iraq are themselves violating Iraqi sovereignty by launching attacks from Iraqi territory targeting US forces in Iraq at the invitation of the Iraqi government and American assets elsewhere in the region.
https://www.understandingwar.org/backgrounder/iran-update-february-3-2024