が原因だった

was the cause

→ が
phrase Rare #35,194
was the cause The thing before が is identified as the cause of something. だった marks past tense.
JA: 遅刻したのは電車の遅れが原因だった。
EN: The train delay was the cause of my being late.

事故は彼の不注意が原因だった。

The accident was caused by his carelessness.

彼の病気は食べ過ぎが原因だった。

His illness was caused by overeating.

トムの病気は食べすぎが原因だった。

Tom's illness was caused by overeating.

彼の昨日の欠席は風邪が原因だった。

His absence yesterday was due to a cold.

何が原因だったんだろう。

I wonder what caused it.