Can't speak for UC-Davis specifically, but most all public university libraries are just that, public. Usually the rule is like so: anyone can use the library, but you have to have a valid student ID or non-student library card (sort of an affiliate card) to check anything out.
If I understand correctly, UC-D has a policy of doing a 100% student ID check after 11:00pm as a safety measure for their students.
If the library is public, as you suggest, why check for student ID? My recollection from my days at UNC in the mid- 70s was that the libraries on campus WERE public, but that may have changed in recent years. I admit I don't know about UC campus libraries.