Weight and armor considerations, mostly. Combined with mission profiles.
Tanks main job is to assault enemy fortifications and break through, on top of providing direct fire support. Tank armor is therefore heavy as hell, meaning tanks need big engines to move all that weight. Big engines mean lots of fuel consumption, which itself weighs even more. Trying to pack all of that into a tank chassis along with a gun system, ammo, optics, loading equipment, etc. means you don’t have much room left over for empty space for carting troops around. And consider, the US Abrams, with all of its safety equipment, is already much larger than most Soviet/Russian tank designs.
IFVs and APCs have a different mission by design – get infantry in, maybe provide some limited support, and get them out. Therefore they prioritize cabin space for troops, smaller guns, less armor, etc.
You have some odd outliers like Israel’s Merkava tank, but mostly it comes down to the above for almost all nations.
Latest Answers