Charles is well known as being on the lower end of the intelligence spectrum, and relegated the actual ruling to others. Godoy's two periods of being top minister are nothing but one long disaster, entering wars that they usually lost (War of the Oranges being the lone exception). Sure, it was a tough row to hoe being Napoleon's neighbor, but Spain's actions were completely disastrous and ultimately led to Nap invading and manipulating Godoy. At the end, Godoy was actively betraying Spain, looking to join Nap in dividing Portugal in return for a small Kingdom (off the top of my head, I want to say the Algarve, but not sure). It's hard to defend a King/Minister duo who led the Spanish Empire into catastrophic destruction.
Why would any other Monarch put effort into Louisiana? Because it was a land worth developing and it gave a nice long buffer between the heart of New Spain and an expansionist US. Spain had a huge empire to manage, but they completely blew it regarding the northern reaches of New Spain. Louisiana was picking up steam when Charles/Godoy were hoodwinking into giving it back to France for an empty promise of Parma. My point was that IF Spain had kept it and put a little effort into it, LA could have paid dividends for them (or for Mexico, IF Mexico still breaks free and the empire falls apart, but then a more competent line of Kings in Spain might have kept the empire together) and they could have blocked the US expansion. It is almost ASB to expect much from the OTL Kings Charles IV and his son Ferdinand, but had more capable succession for Carlos III happened, it is not ASB to think New Spain could have held a border at the Misssissippi.
Well known for being unintelligent by actual scholars or by laypeople? In any case, leaving ruling up to other people when you know you aren't equipped for it seems like a smart idea to me.
None of the wars the pair entered seem like particularly stupid ideas. Do you think other kings would have just ignored king-murdering Jacobins? Actually, after the Directorate overthrew Robespierre and demonstrated how powerful they were, Charles IV and Godoy did the smart thing and allied
with them. Doubtless if they hadn't, people would be railing against them for being so regressive and stupid that they wouldn't take the obvious practical option. Other than that, the pair could have hardly predicted that Napoleon would come to power and embark on his disastrous and unprecedented foreign policy. They had to play along with Napoleon because Napoleon was extremely powerful and
right next to Spain. Again, if they had turned against Napoleon prematurely, people today would probably be trashing them for forcing Napoleon to invade and destroy the Spanish Empire.
How is it "actively betraying" Spain to join an ally in invading a country that you've had multiple recent wars with? Yes Godoy got a part of Portugal as his kingdom but if the partition of Portugal had succeeded, it would still have been great for Spanish interests.
I'm not saying Godoy and Charles IV were geniuses but I really don't see how getting rid of them "does wonders" for the fate of Spain. What policies do you think other rulers should have done in their situation?
There are plenty of places worth developing-like New Spain itself, the most important colony in the Spanish Empire. Louisiana never repaid the cost of governing it and caused a lot of headaches for Spain. If France hadn't illegally sold it to the US, the sale of Louisiana would have been a great idea because it would have given the benefits of a buffer for the valuable colonies while avoiding the costs and headaches of governing it. Given that the Directorate had been trying to obtain Louisiana since 1795, it was perfectly reasonable to think that France wouldn't blatantly violate a treaty with an ally and sell it. In fact, it was only Napoleons terrible decision to invade Haiti and try to restore slavery that crushed his plans for a North American trade empire. If he hadn't done that, there would have been no motivation to sell Louisiana. Why should a different Charles IV put any more effort into Louisiana than Charles III did? I'm not saying that Spain holding onto Louisiana and fending off the US at the Mississippi is impossible. I just don't think the answer lies in replacing Charles IV and Godoy. If France hadn't wanted Louisiana and had actually acted like a reasonable ally, I don't see why Spain couldn't hold onto Louisiana just fine.