Why doesn’t the beta particle stay in the nucleus When a neutron splits into a proton and an electron during beta decay, why does the electron fly out? Should it not stay close to the oppositely charged protons? 
 A: Remember beta decay is a quantum phenomenon. A neutron is heavier than the proton and can decay into a proton and electron and an electron antineutrino. There is no classical attraction between a proton in the nucleus and an electron in the nucleus; a quantum mechanical  solution within the nuclear boundary conditions is not possible:
The electron has energy and momentum, the quantum mechanics solution  for a capture by a proton due to the coulomb potential , is the hydrogen atom. The hydrogen atom levels are in electron volts, the beta decay energy is in MeV, so the electron is too energetic to be captured in a hydrogen atom type of bound state, within the nucleus. The electron with its mev/c momentum leaves the nuclear region.
A: It doesn't always have to fly away. Basically you are talking about electron capture.
Electron capture is sometimes included as a type of beta decay, because the nuclear process, mediated by the weak force, is the same. In electrons capture, an inner atomic electron is captured by a proton in the same nucleus, transforming the proton into a neutron, and a neutrino is released.
Now to your question, in case an electron is released outside the nucleus, why does it fly away. 


The Q value is defined as the total energy released in a given nuclear decay. In beta decay, Q is therefore also the sum of the kinetic energies of the emitted beta particle, neutrino, and recoiling nucleus. (Because of the large mass of the nucleus compared to that of the beta particle and neutrino, the kinetic energy of the recoiling nucleus can generally be neglected.) Beta particles can therefore be emitted with any kinetic energy ranging from 0 to Q.[1] A typical Q is around 1 MeV, but can range from a few keV to a few tens of MeV.


So there are two reasons why the electron flies away:
1.Since the rest mass of the electron is 511 keV, the most energetic beta particles are ultrarelativistic, with speeds very close to the speed of light.
2.the energy balance of the remaining nucleus is much more stable after the beta decay, hence the decay happens, because exactly there was an unbalance of stability (unstable nucleus), that becomes more stable. Would the electron be captured in this case by another nucleon, the whole nucleus would not reach complete (or maximum possible) stability again. 
