Why is torque not measured in Joules?
The units for torque, as you stated, are Newton-meters. Although this is algebraically the same units as Joules, Joules are generally not appropriate units for torque.
Why not? The simple answer is because
$$W = \vec F \cdot \vec d$$
where $W$ is the work done, $\vec F$ is the force, $\vec d$ is the displacement, and $\cdot$ indicates the dot product. However, torque on the other hand, is defined as the cross product of $\vec r$ and $\vec F$ where $\vec r$ is the radius and $\vec F$ is the force. Essentially, dot products return scalars and cross products return vectors.
If you think torque is measured in Joules, you might get confused and think it is energy, but it is not energy. It is a rotational analogy of a force.
Per the knowledge of my teachers and past professors, professionals working with this prefer the units for torque to remain $N \ m$ (Newton meters) to note the distinction between torque and energy.
Fun fact: alternative units for torque are Joules/radian, though not heavily used.
Torque is force at a distance. Work is force through a distance. Same unit dimensions, different measurements.
The reason we distinguish the two is that torque is vector quantity, where as energy is a scalar quantity. So while we give the magnitude of torque the same units as energy, there is in fact additional information that tells us the direction the torque is applied.
UPDATE: As dmckee has pointed out in the comments, to be perfectly corrected torque is a pseudovector, which is equivalent to a mathematical bivector in three dimensions. This distinguishes it from a true polar vector. The distinction is important since the dimension of the pseudovector is n-1 instead of n. This is important conceptually as it is critical to our understanding of conservative forces and central forces, and more specifically the conservation of angular momentum.
In particular, angular momentum conservation implies that motion under central forces will always be confined to a plane.