It's because a matrix describes a linear transformation, and matrix multiplication is defined to correspond to composition of linear transformations. Linear transformations are examples of functions, and composition of functions is a noncommutative property.