The courses are not free, they are paid for, in large part, by the federal government and the state.
California did not back then, but they now have their own legislation known as the Unruh Civil Rights Act and of course there’s the ADA/Rehabilitation Act.
Here’s the kicker - they have to do this whether it is posted publicly or not. The legal requirement does not only apply to public material, but to ALL material and the material still exists/can be accessed with Berkeley credentials. It also applies to future material produced that is used with students/in classes.
My guess is, they had to make it accessible regardless and did this out of spite. They had internal resources to help with this but chose not to do so/made it really expensive because of the volume due to not doing it in the first place.
It is kind of like Cybersecurity - people don’t like to spend the money until they have a breach, where it’s much more expensive to remediate and their costs would be much more manageable/risk reduced has they done it “right” the entire time.
My mother is a professor in the CSU system and I will say California public universities are beginning to take this much more seriously now, largely because of lawsuits.