Diagnosis
The internal detent mechanism for the temperature dial has broken or disengaged, so it's not locking into the set temperature positions.
How to Fix It
This is an internal mechanical failure. The iron is not designed for user repair of the thermostat dial. Stop using it, as an unregulated iron can overheat dangerously.
If That Didn't Work
There is no user-serviceable fix. Your options are warranty claim (if applicable) or replacement. Do not continue using an iron with a faulty temperature selector.
Heads Up
A loose dial that free-spins means the thermostat is likely not functioning correctly, posing a burn risk and a potential fire hazard if left on unattended.