Usually, it is after a nucleus has decayed via a $\alpha$- or $\beta$- decay that it is left in a excited state. To see this let us consider the decay of Co-60 into Ni-60.
Co-60 is an unstable nucleus because it has to many neutrons, and therefore it decays in the most probable channel by turning a neutron into proton according to the decay mode
$^{60}$Co$_{27}\rightarrow ^{60}$Ni$_{28} + e^-+\bar{\nu_e}$
or at the nucleon level
$p\rightarrow n+e^-+\bar{\nu_e}.$
The nucleus of Ni$-60$ finds itself in the new configuration of protons and neutrons which does not correspond to the lowest energy level, because the newly created neutron is at a higher energy level due to the decay. So at this stage Ni$-60$ is in an excited state Ni$^*-60$
From this point on the nucleus of Ni$^*_{60}$ will decay to attain its lower energy state. Imagine the similar situation in an atom, where an electron from an inner shell, $E_i$ say, is shot out by a laser beam. The remaining atom is in an excited state because there can be an electron in an outer shell, $E_o$ say, and it will therefore make a transition to the energy level that has just been evacuated.
So Ni$^*-60$ will decay in a cascade with 2$\gamma$ photon emission as shown in the following decays
$^{60}$Ni$^*_{28}\rightarrow$ $^{60}$Ni$^{\prime*}_{28} + \gamma_1$ still an excited state,
$^{60}$Ni$^{\prime*}_{28}\rightarrow$ $^{60}$Ni$_{28} + \gamma_2$ and this is the ground state of Ni-60.
where $E(\gamma_1)$=1.333 MeV and $E(\gamma_2)$=1.173 MeV.
The nucleus of an element can be left in an excited state after an $\alpha$-particle emission as well, and the reasons for the $\gamma$-particle decay are very much the same.