So, if you look at the foreign language requirement for what it is (an "expand your mind" requirement), then it is plainly obvious that coding achieves the same objective.
For the most part I agree. But foreign languages open up way more entertainment opportunities. Theres a strong cultural issue with this in the English speaking world.
One thing that I've noticed, being a primarily English speaker who has lived immersively in many, many non-English cultures; Monolingual English speakers tend to avoid music of other cultures with other languages far more than monolingual speakers of other languages who will very often happily listen to and appreciate music with vocals they don't understand.
Theres a snobbishness to native English speakers that you don't often find in other language groups.
Teaching, or at the very least, exposing native English speakers to other languages opens their minds in ways that programming does not.
I'll grant you that programming opens their minds in ways that foreign languages do not but at the end of the day, on balance, I'd say that getting people to be more social and more aware of other people and cultures has more overall net benefit to individuals and to society.