Your question has two parts.
First addressing why electron needs a closed loop to flow-
Consider a wire which is not closed for e.g in the diagram.
Here Due to the electric field(marked in green) the electrons move to the right.But after some time the electrons accumulate in the right forms their own electric field with the positive charge(marked in red).As a result both Electric fields cancel together and current stops flowing.Tragic...
But this does not occur in closed loops which helps to maintain the current.
Addressing the second part of your question
The battery in the circuit is removed after the capacitor is fully charged, when the interruptor is closed for some reason electrons want to flow.
After the capacitor is fully charged,a potential difference is established between the two plates and obviously electron wants to flow by some path or the other-their target is to do work by the potential energy they have.As the electric field is conservative the path does not matter.Now,how will they flow if wire is not closed??So as soon as the wire is closed they start to flow due to the potential difference.