ためではありませんでした
tamedewārimasendeshita

Noun
Desu Copula

The polite, past negative form of ため

1. Was not for the sake of.; Was not the reason.; It wasn't for.

Past/Perfective
Negative
Polite
Formal Register