yes, that is the usual reason given for Portugal. It's not wrong, but....
I find it incredible that Napoleon dreamed up the Portugal invasion and then ad hoc decided to take Spain while he was at it.
I've read in various places that the French were taking detailed notes while they crossed Spain to get to Portugal. they were planning all along to make Spain part 2 of the Portuguese invasion. The invasion began with French troops inside Spain allegedly on their way to/from Portugal. so, yes, it is born out by historical sources.
That's my point. the Portuguese invasion was simply the preliminary phase of the Spanish invasion. OTL, you cannot separate the two. IMO, they were one and the same as planned, and as executed. People like to treat them as two entirely different entities,that France woke up on the way to Portugal and then eh, what the heck, let's take this country, too.
This isn't to say that France wouldn't have taken out Portugal while keeping Spain as an ally. They were a minor thorn in France's side, but also were easy to remove. I merely posit that Portugal was not a separate action from Spain, OTL.