In theory, a well endowed school can hire more faculty (as well as build enough facilities) to cover the expected student demand for the courses and have enough headroom for typical yearly fluctuations.
Generally, it appears that restrictions on majors are due to capacity limitations. An example at Berkeley is the computer science major in its College of Letters and Science. Prior to the early 2000s, it was a restricted major that required a GPA higher than 2.0 in its prerequisites to declare. Popularity dropped after the tech bubble crash, so from the early 2000s, it was effectively non-restricted, with the GPA requirement being dropped to 2.0 in its prerequisites to declare. More recently, surging popularity* resulted in it becoming a restricted major again, with the GPA requirement being raised to 3.0 a few years ago, and again raised to 3.3 for students starting fall 2015.
*Introductory CS courses for CS majors grew to over 1,000 at Berkeley, and over 700 at Stanford and Harvard.