Why must $U(1)$ matrices commute with $SU(2) \times SU(3)$ matrices in embedding within $SU(5)$? I'm a physicist taking a groups course.
I can believe that the direct sum of the fundmental representations for the $SU(2)$ and $SU(3)$ matrices will work as an embedding of the $SU(2) \times SU(3)$ subgroup within the fundamental representation of $SU(5)$ (since you have a 5x5 matrix composed of a 2x2 block and a 3x3 block so obviously they act on separate vector subspaces as in the direct product).
However it is often said that to embed $SU(2) \times SU(3) \times U(1)$ we can just also use a representation of 5x5 matrices for $U(1)$ which commutes with the above matrices. I don't understand how this commuting constraint means that the $U(1)$ part of the subgroup acts on a 'separate vector space' like the direct product suggests?
 A: I'm not quite sure what your question is. The U(1) does not rephase SU(5) quintuplets uniformly: it rephases the doublet direct summand differently from the triplet summand, because these have different hypercharges.
Taking generators τ in su(2) to be your 2×2 matrices, and likewise their exponentials, and T in su(3) to be 3×3 matrices, the hypercharge U(1) generator Y is a 5×5 diagonal matrix  diag(3,3,-2,-2,-2), suitably normalized. So it commutes with anything in the 2×2 block and anything in the 3×3 block, and is traceless, as a generator of SU(5), but it straddles both blocks, and rephases them differently, albeit in tandem.
That is, Y is not in a separate direct summand, but, as τ, T, and Y all commute amongst themselves, they generate the Cartesian product of the subgroup, i.e., their group parameters are fully independent of each other. Y amounts to two, related, rephasings for the 2 and 3 direct summands of the 5-vectors, respectively.
So, a group element  in the unbroken subgroup of SU(5) you are considering is
$$\large
e^{i (\theta \cdot \tau +3\alpha  I_2 )~\oplus ~ i(\phi\cdot T -2\alpha I_3)} =e^{i (\theta \cdot \tau +3\alpha  I_2) } ~\oplus ~ e^{i(\phi\cdot T -2\alpha I_3)},
$$
where θ, φ, α are the SU(2), SU(3), and hypercharge "angle parameters", respectively (a triplet, octet, and singlet, respectively). Work out the exponential of the block matrices to see how the blocks in the exponent evaluate to a direct sum of blocks as well, perhaps counterintuitively, but pursuant to the direct sum homomorphism, preserving the block split. The first  direct summand now acts on the 2×2  block, while the second on the 3×3  block.
It is a neat feature of this unification that the charges of colored particles (the triplet block) are thus pegged to the charges of the leptons ("charge quantization")!
