My mother asked us why we had done such a thing.

Literal

Mother [topic-は] us [to-に], why such thing [object-を] did [question-のか] [quotative-と] asked

なぜそんなことをしたのかと訊ねた = 'asked why (we) did such a thing.' のか = explanatory の + question か, embedded in a quoted question. 訊ねる (たずねる) = to ask/inquire — the kanji 訊 specifically means 'to question.'