I think it's pretty common for schools to intentionally use some lower level courses as washout courses to avoid wasting resources on someone who won't be able to cut it at the upper division. Remember that STEM degrees cost the university significantly more as well. Calc II, E&M, and the first algorithms course all have very high failure rates.