There is a third option: Do undergrad outside the US. Then with a BSc from outside the US, get a job in the US. At least in my company (in the US) the hiring managers in software engineering are nearly all from India. As such they will know the quality of the computer science departments in universities in India. In the past we used to hire a lot of software engineers who had a Bachelors from India and a Master’s from the US. By now I think that we are just hiring folks straight out of universities in India. It is not clear whether Trump will change H-1 visa rules to make this more difficult for our company, but since your son is a US citizen this potential problem doesn’t apply to him.
Also, in software engineering as far as I know salaries are based on what you can do, and what you have done. As such, I think that you might assume that the salary will be the same for the same capability. Thus just look at the total cost of the education. I am guessing that this “third option” will generally win from an economic point of view.
Thanks for posting this question. I have wondered the same thing. My US-born dual-citizen daughter is on her way to a very good highly ranked very inexpensive small university in Canada. I have wondered to what extent hiring managers in the US will care that she went to university outside of the US (although to be honest I have no idea whether she will want to return after graduation).