As can be seen, the last known value of y is stored in all of m instead of the different values of y in each iteration. Is there something wrong in my understanding?
When you push!(m,y) you are actually storing into m a reference to the array y, instead of copying the contents. That’s why if you modify an element in y, you will see the change in all of the elements of m: because you are actually looking inside the same y.
In languages where assignment creates an independent array, you can avoid the copy when you assign but the copy is still made later if you modify either of the two arrays. This is “copy on write” behavior, which is how both R and Matlab do this. So your example would allocate in any language.
They are not being stored row-wise, it’s just that when you have a vector of vectors, those inner vectors are printed in rows to fit more compactly on your screen.