In Dead Poets Society (1989), in the school, why are they storing these guns in a showcase?
The school in question is a fictional Private school. As such, the restrictions and laws governing Public schools are not the same.
Also, consider that Dead poets Society also came out a full decade before the Columbine High School incident, which really is a benchmark in that while school killings weren't unheard of, they hadn't been as widely publicized and brutally conducted.
Back to the school... In private schools such as the one depicted, it's not uncommon for a teacher to display a bit of themselves. Their passions. Their hobbies. It's pretty clear that the teacher in question was a gun enthusiast and possessed several guns which were displayed, from current smaller firearms to larger Revolutionary War-era muskets. You can see that each of them is tagged, though it's impossible to read the tags. I'm sure other teachers' offices might have displayed an arthropod collection or something else that gives you a little insight into who the teacher is and what that teacher's passion is.
Today, they may have been more sympathetic to school violence and changed what was in this office, but at the time the movie came out I'm sure it was perfectly acceptable.
So, to wrap it up, these guns are not being "stored" in showcases, they're being "displayed" in showcases.