Action of SL(2,Z) on upper triangular primitive integer matrices of determinant N, from the right. Is it transitive?

Yes, the action is transitive. It is easier not to choose a set of coset representatives for the left action, so the question is whether $SL_2(\mathbb{Z}) \times SL_2(\mathbb{Z})$ acts transitively on $M_N$ (under left and right action). We will want the following notations: Let $\tilde{M}_N$ be all integer matrices of determinant $N$; let $GL_2(\mathbb{Z})$ be the integer matrices with determinant $\pm 1$.

The double coset representatives for $GL_2(\mathbb{Z}) \times GL_2(\mathbb{Z})$ acting on $\tilde{M}_N$ are given by the matrices in Smith normal form: $\left( \begin{smallmatrix} a&0 \\ 0&b \end{smallmatrix} \right)$ with $a|b$, $ab=N$ and $a$, $b>0$. Such a matrix is only primitive if $a=1$, so the $GL_2(\mathbb{Z}) \times GL_2(\mathbb{Z})$ orbits on $M_N$ are represented by $\left( \begin{smallmatrix} N&0 \\ 0&1 \end{smallmatrix} \right)$.

We now must pass from $GL_2(\mathbb{Z})$ to $SL_2(\mathbb{Z})$. We have shown that any matrix in $M_N$ is of the form $\gamma_1 \left( \begin{smallmatrix} N&0 \\ 0&1 \end{smallmatrix} \right) \gamma_2$ with $\gamma_1$, $\gamma_2 \in GL_2(\mathbb{Z})$. Moreover, taking determinants, we must have $\det(\gamma_1) = \det(\gamma_2) = \pm 1$. If the sign is $+$, we are done. If it is $-$, replace $\gamma_1$ by $\gamma_1 \left( \begin{smallmatrix} 1&0 \\ 0&-1 \end{smallmatrix}\right)$ and $\gamma_2$ by $\left( \begin{smallmatrix} 1&0 \\ 0&-1 \end{smallmatrix}\right) \gamma_2$.


Let me add another proof that highlights a connection with the Hecke congruence subgroup $\Gamma_0(N)$.

Let me abbreviate $\Gamma:=\operatorname{SL}_2(\mathbb{Z})$. We would like to know if the right action of $\Gamma$ on $\Gamma\backslash M_N$ is transitive. The size of the orbit of a coset $\Gamma g$ (where $g\in M_N$) equals the index of its stabilizer $(\Gamma:\Gamma\cap g^{-1}\Gamma g)$. Let us specify $g:=\left(\begin{smallmatrix} N&0 \\ 0&1 \end{smallmatrix}\right)\in M_N$. Then a quick calculation reveals that the stabilizer $\Gamma\cap g^{-1}\Gamma g$ is precisely $\Gamma_0(N)$, whence the orbit has size $(\Gamma:\Gamma_0(N))$. However, this index is known to be equal to the cardinality of $D_N$, so the action is transitive.

Added. The lastly mentioned fact has several proofs. One natural proof is to take a set of representatives of $\Gamma_0(N)\backslash\Gamma$ which has the same cardinality as $D_N$. Here is an explicit construction. For any decomposition $N=ad$, take a set of integers $c$ coprime with $a$ which represent all residue classes $b$ mod $d$ satisfying $\gcd(a,b,d)=1$; this is possible by an application of the Chinese remainder theorem. Extend the resulting pairs $(c,a)\in\mathbb{Z}^2$ to matrices $\left(\begin{smallmatrix} \ast &\ast \\ c&a \end{smallmatrix}\right)\in\Gamma$, then these matrices will represent $\Gamma_0(N)\backslash\Gamma$.