At my university everybody can just walk into the library during normal hours. After that, you need a (photo id) library card (which you can get right there in the library for 10 euros).
This card not only allows you 24 hour access to the building itself, but to also loan books, get access to journals and newspapers, etc...
I certainly can't speak for every university library here in germany, but I have so far seen quite a few (visiting friends all over germany), where this is common practice (I do not know about getting a library card there, though).