She was extremely upset that she couldn't go.

Literal

She [topic-は] herself [subject-が] cannot-go fact [over-で] greatly was-troubled.

ことで marks the cause or grounds of the trouble — 'over the fact that.' こと nominalizes the embedded clause 自分が行けない ('she can't go') into a noun phrase, and で gives it a circumstantial reading: 'troubled over [this fact].' たいそう ('greatly, considerably') is a slightly literary intensifier; in modern speech a learner is more likely to hear とても or ひどく. 悩んでいた is the past progressive of 悩む — an extended state of distress, not a one-off moment.