Yes I think we should have stayed in Afghanistan indefinitely and so do many military and political commentators including Rory Stewart who knows more about Afghanistan than you or me. We should have had small permanent bases with air support let the Afghan army do the ground fighting. Once we left them it was inevitable the Afghan army would fold.
Now we are in a very vulnerable position strategically and once again exposed to major terrorist attacks like 9/11.
But even if you disagree with above the organisation of the withdrawal has been catastrophic and it’s clear Biden is a dangerous liability and incapable of functioning probably in any capacity
I don't think it was possible for Biden to have stayed after that the US had already negotiated a truce with the Taliban, otherwise, what credibility would the US have internationally, an agreement cannot be dependent on a country head, yes there can be a new agreement if the other party wants to negotiate, but you cannot just go back and say, it was my predecessor who signed the deal. A country head represents a country, not himself.
As for staying there, you are probably right, but this is not what Americans wanted/voted for as much as I remember, maybe Trump should have understood and explained the danger for Americans themselves.