It's not the US as a whole, it's specifically Silicon Valley and San Francisco where you have this ridiculous concentration of huge software companies (all of FAANG except Amazon have their headquarter there) and venture capital firms (and thus startups), generating an extreme demand for developers.
But of course, that demand drives up salaries across the entire USA to some degree.