Why is the energy of an electron always negative?
First of all, regarding your comment, Rydberg's constant is not negative. If it were, then the equation you gave would have a positive energy all the time.

To be precise, Rydberg's constant is $$R_{\infty}=\frac{m_ee^4}{8\epsilon_0^2h^3c}$$ where all those constants have their usual meanings. Importantly, all of those constants are manifestly positive.

Whether the energy is positive or negative is entirely arbitrary. The energy of an electron can also be formulated as, $$E_n=R_h(1-\frac{1}{n^2}).$$

The only difference between the equation you wrote down and the one I just wrote down is that the above equation sets the zero of energy at the ground state of the hydrogen atom. You'll see that when $n=1$ the energy is zero and as $n\to\infty$ the energy approaches the Rydberg constant which is the ionization energy of the hydrogen atom.

When you say you wrote your exam I assume you mean you took your exam, not that you were writing the exam? Haven't heard that expressions before, but I suppose it makes sense. Maybe you were supposed to write that the negative energy represents the fact that the electron in a hydrogen atom is more stable (lower in energy) when associated with a proton than when isolated by itself.