Let $\gcd(m,n)=d$ and put $m=dx,\ n=dy$ so that $x,y$ are now coprime. [We will assume that $x>y.$]
Replacing $m,n$ by $dx,dy$ in $T$ gives
$$T=\frac{d^2k\cdot 2xy\cdot(x^2-y^2)}{x^2+y^2}.\tag{1}$$
Now if $x,y$ are of opposite parity, the triple $(2xy, x^2-y^2,x^2+y^2)$ is a primitive Pythagorean triple. This means that the denominator of (1) is coprime
with the second and third factors in the numerator of (1), and thus $T$ is an integer iff $x^2+y^2$ divides $d^2k.$
The remaining case is when $x,y$ are each odd. Here looking mod 4 one sees that $(x^2+y^2)/2$ is odd, and it is easily shown that if $T$ is now written as
$$T=\frac{d^2k\cdot xy\cdot(x^2-y^2)}{(x^2+y^2)/2}.\tag{2}$$
then the denominator is coprime with the second and third factors in the numerator, so that $T$ is an integer in this case iff $(x^2+y^2)/2$ divides $d^2k.$