Why does the convective core in an intermediate to high mass star shrink?
Whether convection exists depends on whether the interior radiative temperature gradient reaches the adiabatic temperature gradient. 

The interior radiative temperature gradient is proportional to the opacity and the outward energy flux, and inversely proportional to $T^4$. As the star evolves on the main sequence, the central temperature goes up and the opacity (e.g. Kramer's opacity goes as $T^{-7/2}$ goes down. You are also removing free electrons (combining them with protons to form He) which reduces the Thomson/Compton scattering opacity. This means the radiative temperature gradient goes down and can fall below the adiabatic gradient, meaning that energy transport reverts to being radiative. 

It stays convective right at the centre for longest because that is where the radiative temperature gradient is still largest (driven by the extreme temperature dependence and high outward energy flux of the CNO cycle nuclear reactions).