Great post! I have recently written about this myself, comparing and contrasting the US and UK (my own) systems. This problem is largely avoided in the UK because there are no electives. My undergraduate degree was in zoology, so I didn’t even take classes in other fields of biology (botany, biochemistry, etc.). I would’ve killed to take some classes outside of my field, perhaps classics or art history, but it wasn’t an option. So the UK system is too specialized. The US system in contrast errs in the other direction: too diffuse. Undergraduates have to take so many classes outside of their field that 1) an extra year is required in both undergraduate and masters degrees compared with the UK to catch up, and 2) some undergraduates do not have time for an independent research project, arguably the most important component of a science education.
I think the solution is a halfway house. Undergrads should be free (and encouraged) to explore classes outside of their discipline, but they should only be able to take them as pass/fail perhaps, or just as an audit.