If $A$ is a $p \times q$-matrix then it transforms a $q \times 1$ vector to a $p \times 1$ vector (over $\mathbb{Z}_m$ in your case). This can only be bijective (invertible) iff $p=q$ because we map $\mathbb{Z}_m^q$ to $\mathbb{Z}_m^p$ and these sets have the same size iff $p=q$. So we need a square invertible matrix to get a valid encryption system with unique decryption.