I have this naive question. We know that the expansion of the universe "takes" or "carries" the galaxies with it, separating them, but this doesn't apply to photons. My guess is that it has to do with the fact that photons are massless (i.e. they always move with c), but I am not sure and would like a more physical explanation or insight.
Expansion isn't some mysterious force that "carries" galaxies. There's a very common misconception that it is, but it's not true. The expansion is just the recessional motion of galaxies and other matter.
Light does participate in the expansion. Even though it moves at a constant speed (and therefore can't move with the galaxies as you correctly observed), it still thins out with time. This is counterintuitive, but it happens even in a special relativistic cosmological model (the Milne model, which is a special case of FLRW cosmology). If you think of the big bang as an explosion of light bulbs, the bulbs that you see from a particular era in the universe's history have higher and higher relative speeds as time goes on (since the light from nearer, slower bulbs has already reached and passed you), and therefore are more redshifted, and therefore emit photons at a lower rate (since redshift affects the perceived rate of every process). So the relic photons from a particular era of the universe's history get more redshifted and less dense as time goes on.