No hay ningún peligro, no tienes por qué preocuparte.

English Translation

There is no danger in this you needn’t worry.

Is “por” necessary here?

Yes, it’s required. I would translate it as “There’s no danger, you don’t have anything to worry about” or “you have no reason to worry”. Prepositions cannot go at the end of a sentence in Spanish. It’s worth noting that there is also “el porqué”, which would be like “the reason”. Since por has to do with causation, it makes sense that it forms part of words like “why” and “because”.