We study the stellar, brightest cluster galaxy (BCG) and intracluster medium (ICM) masses of 14 South Pole Telescope (SPT) selected galaxy clusters with median redshift z = 0.9 and mass M500 = 6 × 1014 M☉. We estimate stellar masses for each cluster and BCG using six photometric bands, the ICM mass using X-ray observations and the virial masses using the SPT Sunyaev-Zel'dovich effect signature. At z = 0.9, the BCG mass M_{star }^{BCG} constitutes 0.12 ± 0.01 per cent of the halo mass for a 6 × 1014 M☉ cluster, and this fraction falls as M_{500}^{-0.58± 0.07}. The cluster stellar mass function has a characteristic mass M0 = 1011.0 ± 0.1 M☉, and the number of galaxies per unit mass in clusters is larger than in the field by a factor of 1.65 ± 0.20. We combine our SPT sample with previously published samples at low redshift and correct to a common initial mass function and for systematic virial mass differences. We then explore mass and redshift trends in the stellar fraction f⋆, the ICM fraction fICM, the collapsed baryon fraction fc and the baryon fraction fb. At a pivot mass of 6 × 1014 M☉ and redshift z = 0.9, the characteristic values are f⋆ = 1.1 ± 0.1 per cent, fICM = 9.6 ± 0.5 per cent, fc = 10.7 ± 1.1 per cent and fb = 10.7 ± 0.6 per cent. These fractions all vary with cluster mass at high significance, with higher mass clusters having lower f⋆ and fc and higher fICM and fb. When accounting for a 15 per cent systematic virial mass uncertainty, there is no statistically significant redshift trend at fixed mass. Our results support the scenario where clusters grow through accretion from subclusters (higher f⋆, lower fICM) and the field (lower f⋆, higher fICM), balancing to keep f⋆ and fICM approximately constant since z ∼ 0.9.