It certainly was illegal
When I was getting my Master's degree, the university started formally tracking and charging for all those photocopies. That way, they could address the copyright issues.
I kept most of my books in my major, but got rid of the rest. In retrospect, I could have gotten rid of most of those as well... I haven't had much chance to study French grammar in the last few years...