How important is taking a foreign language?

Thank you to all who replied! My school only offers 3 years of foreign language so 4 is out of the question (Spanish 1,2, and AP). I decided that I’m probably just going to go for AP since Spanish isn’t even that difficult and just so I can be on the safe side. Most of the alumni who went to Ivies to major in engineering (nearly all of them because I go to a STEM school) took AP Spanish.