To pick-up on a few selected points made by Damuri Ajashi:
The cash incentives offered to CR7 and Messi to play in friendlies are negligible compared to their earning power. Most of the big European international team players donate all the money they receive from international football to charity.
The USMNT though are a little different, whilst none of them need the money from the USSF, for many it is a nice little bonus. There are real economic reasons for paying the USMNT players what they do, in particular the current deal came about after the core of the USMNT went on strike and this is not the first time they have been on strike either. In short the USSF has to pay the USMNT players a reasonable chunk of the money they generate in order that the USMNT players do not feel exploited by the USSF and go on strike.
Players cannot change their national team at will, to play for an international team you have to meet the FIFA requirements and any requirements of the particular association. Players who are eligible for more than one country are pretty much locked into that nationality once they have played for that team, except in very limited circumstances.
That said, the USMNT has notably fielded quite a few players who have been original eligible for other national teams and also has notably ‘lost’ to other national teams a few players who were originally eligible for for the USMNT. This means they are probably more sensitive than most to attracting players who might otherwise play for someone else, but at best this will only be a very minor consideration in player compensation.
For the USWNT the economic reasons for pay are quite different. There isn’t a huge amount of money in women’s soccer, however the reason why the USSF is still fairly generous with its compensation is that a lot of its players have career options outside soccer.