Legally, there is no such thing as a student newspaper. That is, a student newspaper is governed by the same laws as any other publication. This means that legally, each (student) newspaper needs a ViSdP (Verantwortlicher im Sinne des Presserechts - Responsible Person for the purpose of press law). The ViSdP can be anyone and has control over the content of the newspaper.
If the principal of the school acts as the ViSdP of the student newspaper, the principal is also able to censor the content. If, however, the ViSdP is someone else, the principal has no control.
Anybody from the age of 7 can publish a (student) newspaper. Only requirement is that under the age of 18, parental permission to run a business is needed.
Note that “running a business” includes hiring a lawyer and filing lawsuits, so an underage publisher who has permission to publish a newspaper from their parents can sue their school without the need to have the lawsuit approved by their parents.
In practise, however, censorship of student newspapers is very common because many students seem to be unfamiliar with their rights. You can google „Zensur von Schülerzeitungen“ for more information.
https://www.augsburger-allgemeine.de/bayern/Jede-dritte-Schuelerzeitung-zensiert-Viele-Schulleitungen-haben-um-den-Ruf-der-Schule-Angst-id19883071.html