。
Because of the storm, we had no choice but to stay home.
Literal
Storm [because-of-ため] we [topic-は] unavoidably house [at-に] be-must.
やむなく ('unavoidably / having no choice') is a formal adverb that stacks an emotional tone onto an obligation. It signals that the speaker would have preferred otherwise — 'reluctantly forced to.' The combination やむなく…なければならなかった is a heavy, written-register way to say 'had to [do X] and didn't want to.'