Using the IllustrisTNG simulations, we investigate the connection between galaxy morphology and star formation in central galaxies with stellar masses in the range 10 9 − 10 11.5 M . We quantify galaxy morphology by a kinematical decomposition of the stellar component into a spheroidal and a disc component (spheroid-to-total ratio, S/T) and by the concentration of the stellar mass density profile (C 82 ). S/T is correlated with stellar mass and star-formation activity, while C 82 correlates only with stellar mass. Overall, we find good agreement with observational estimates for both S/T and C 82 . Low-and high-mass galaxies are dominated by random stellar motion, while only intermediate-mass galaxies (M ≈ 10 10 − 10 10.5 M ) are dominated by ordered rotation. Whereas higher mass galaxies are typical spheroids with high concentrations, lower-mass galaxies have low concentration, pointing to different formation channels. Although we find a correlation between S/T and star-formation activity, in the TNG model galaxies do not necessarily change their morphology when they transition through the green valley or when they cease their star formation, this depending on galaxy stellar mass and morphological estimator. Instead, the morphology (S/T and C 82 ) is generally set during the star-forming phase of galaxies. The apparent correlation between S/T and star formation arises because earlier forming galaxies had, on average, a higher S/T at a given stellar mass. Furthermore, we show that mergers drive in-situ bulge formation in intermediate-mass galaxies and are responsible for the recent spheroidal mass assembly in the massive galaxies with M > 10 11 M . In particular, these massive galaxies assemble about half of the spheroidal mass while star-forming and the other half through mergers while quiescent.