A loop seems a heck of a lot clearer (and doesn’t temporary arrays like your second approach). Nothing wrong with loops in Julia.
Another possibility would be to use a different data structure. e.g. make M into a matrix of matrices (or SMatrix from StaticArrays.jl, if they are small and fixed-size). But that depends on what you want to do with M afterwards.
Unless your matrix is sparse, I would also suggest simple concatenation via [ ] (aka hvcat). I find
[A B
C D]
to be quite a bit more readable. Although if you still need to access these submatrices after construction, then your [@view ...] solution seems appropriate.