All Arab Gulf countries are colonized and have no say in what they can do and they cannot push the US out, militarily (or are afraid to do so). Iran understands this very well and this is why they are only hitting US bases in those countries, noting else.
But some countries fully support the US diplomatically too (in case of UAE they are even threatening Iran militarily and maintaining diplomatic relations with israel) and in those cases, Iran is not letting their shipments go through and also taking further actions.
Iraq though is different in that they are still powerless to push the US out militarily (hence the US bases), but at the same time, they are also refusing to oppose Iran diplomatically and have not threatened Iran militarily. That is why Iran is okay with their shipments going through.
Its all a very sound strategy, in my opinion.