I must take issue with your assumption that the French went into Spain `with good intentions`.
Their entire operation was an elaborate plot to gain control of that state by means of treachery. N`s devious little mind worked in overdrive to hatch that one.
He cunningly lured the Spanish royal family into his lair, where he manipulated them into renouncing their throne.
He then gave that throne to brother Joseph; perfect puppet for his further manipulation.
He cunningly lured 10,000 of their best troops up into Denmark, thus emasculating their army in Spain.
He cunningly injected thousands of `friendly` French troops into Spain, with orders to seize the fortresses controlling the border with France by stealth.
I doubt that these measures show that he was interested in the good of the Spanish people.
N was interested in the good of N.