Although the US invaded Iraq which ultimately led to the creation of the bases currently there, the forces now in country are there with the permission of the current Iraqi government, which the US is at peace with.
There is a massive world of difference between having a military base in a country at with the permission of that country versus having one as an invading force. The question really comes down to how much force the Iraqi government would be prepared to use to remove the US bases if the US doesn't remove them willingly. It is obvious that the Iraqis could overrun any US military presence currently in the country in short order if that is what they wanted to do - these bases aren't remotely set up to be strongpoints engaged in 360 degree active combat with a hostile force and supplied purely by airlift from a neighbouring country. They exist with the logistical and security support of the Iraqi government.
Basically, the existing bases are undefendable, and if the US is going to insist on acting like an occupying invasion force in hostile territory, the bases are toast. The US would have to mount a full scale invasion like in 2003 to destroy the Iraqi military and government en masse in order to secure those bases, and it simply can't do that in the timescale that those bases would continue to exist for.
Politically, the US is going to have very few allies backing it up if Iraq asks the US to remove its bases and the US refuses. Probably no allies at all in fact, since the US would be clearly seen as the aggressor in this scenario.
Iraq serves as a useful, but not indispensible, base of operations for US actions in Syria and the middle east generally, although obviously there are plenty of bases in other countries in the region too. It is hard to see any upside for the US in violating Iraqi sovereignty to keep these bases (especially given that it can't keep them if Iraq is prepared to use force to remove them).
The US is already facing possible conflicts with Iran and North Korea, steadily escalating tensions with China particularly in the South China sea, and a certain degree of confrontation with Russia. Having bases in Iraq seized or fighting a war to regain control of the country and install a new puppet regime is not something the US wants to be dealing with right now when it is entirely avoidable.