The west was in Iraq for a decade and achieved little. How would staying longer help. No country wants another country to rebuild it,or interfere.
Clearly, you haven't had the opportunity to actually see what was accomplished in Iraq. Frankly, I'm a little amazed you even ask the question. Let's see if we can determine what we achieved ...
322 schools built
84 hospitals built
36 electric plants constructed
171 water distribution systems built
Estimated 2.7 million Iraqis provided medical services
70,000 Iraqis placed annually in jobs by US-led JOBS program
3 generations of Iraqis got to vote for the first time in their lives
Allowed Iraqis to have an input in their government for the first time in 1000 years, maybe ever
Uncounted number of lives saved by bombing interdiction missions
Desconstructed terrorist training sites and WMD production facilities
Removed a dictator from power - one who is estimated to have killed about 3 million countrymen, used WMDs on Kurds and Iranians, and stole approximately $30 billion from the food for refugees programs
Supported a working consensus government established by the Iraqis
Allowed government to develop their own Constitution
As for staying longer .... I would guess all you have to do is count the number of dead since the US left in order to determine what staying longer would have meant. Clearly, ISIS would have stayed underground because they would have been fighting the US. The government would have had sufficient time to develop the bureaucratic infrastructure necessary to manage a country. The government would have been able to stabilize its military structure under civilian control. The people would have had time, and security, to modify their government to meet their needs, and eliminate the thieves.
Instead, because of domestic politics - and an incredibly stupid foreign policy decision by the current regime - we pulled out the stabilizing effort provided by the US military, created the environment in which crooked politicians were able to integrate their cronies, left an Iraqi military without the command structure and control systems necessary to protect their country, one out of every nine Iraqis have been driven from their homes, an estimated 78,000 civilians have died since January 2014, 17,000 Iraqi military have been killed, and we invigorated and emboldened the Islam extremists to the point that they have destroyed two countries, and made significant strides toward coalescing the fragmented Islamic terrorist groups into a single entity.
Yeah, other than that ... we should never have been there, and we did the right thing to leave.