the dimensions of torque are the same as those of energy. Why it would nevertheless be inappropriate to measure torque in joules.

Energy is force x distance, where distance is the distance in the direction of force. Torque is force x distance perpenduclar to force.

Joules is a measure of energy. Torque is rotational force, not energy.