And you don't think that the letter offering Spanish support to Prussia if France was defeated is an act of treachery by an ally?
Napoleon's immediate reaction was to 'request' Spanish troops to be sent to northern Germany which were sent under Romana. He was in the middle of a campaign and had to deal with Spain later, which he did. Spain was an internal mess, with Godoy playing his internal games which lasted until he was finally forced out in March 1808, and the 'family feud' within the Spanish Bourbon house.
Again, I suggest that you actually establish a timeline for the events beginning with the discovery of the correspondence from Godoy to Prussia while Napoleon was in Berlin and go from there. It isn't as simple as you portray it.