What I've never been able to figure out is why then the space within galaxies, indeed the very space within matter itself, is not expanding also.
The curvature of space-time depends upon the matter distribution. Far away from matter (in the immense voids of the large-scale structure of the universe, far away from the clusters and super-clusters which are confined to the filaments), the global distribution of matter in the universe dominates and gives rise to expanding space (which is just how we see a particular form of space-time curvature from our 3d POV).
In proximity to matter (inside the clusters, galaxies, solar systems, planets, atoms), it those distributions which dominate and dictate the local space-time curvature. The Earth itself dominates our curvature here, and local space-time takes on the Schwarzschild geometry.
Consider the global curavture as a hill, and local Schwarzschild curvature as a hole. From inside the hole, the hole looks like a hole, with no clue to the fact that it is situated on the side of a hill. From afar, you simply see the slopes of the hill, and no hole.