As long as the smartest people can make more money by majoring in marketing, business, and finance (while also partying during the nights and weekends the STEM majors need to study - less strenuous) there will be a shortage of qualified STEM grads.
Also, too many have seen their parents and others in the STEM fields careers be suddenly changed by mass layoffs.
The answer is the same, shortages raise the cost (Salary) and security to increase the supply.
You can’t do that by importing hundreds of thousands of equally unskilled workers who’re willing to be cubicle slaves for a pittance.