When I looked through the telescope, I saw it was a torch.

Literal

Telescope [by-で] see-[when-と], that [topic-は] torch [that-であることが] understood.

で marks the instrument (telescope as means). ~であることがわかる is a fixed pattern for 'to turn out to be, to be revealed as' — である (literary copula) + こと (nominalizer) + が + わかる ('to understand, to become known'). たいまつ ('torch, flame torch') is written in hiragana here but can be 松明. A dramatic discovery moment.