Do I get a prize?Others have already pointed out that you have an obvious fault with your drivetrain and with that much movement on your cassette it looks to me like you have at least one collapsed bearing either in the freehub or the rear hub or both. Whatever the cause there is now ay you should be riding it like that since it could lead to damage that cannot be repaired without a new hub. It will take less than 10 minutes to strip the cassette and freehub off the rear hub and check what is going on there.
Glad its fixed mate, but now you need to make sure it does not happen again! Most freehub assemblies rely only on fairly feeble rubber seals and some grease to prevent water, dust, mud ingress. The grease on those seals needs renewing fairly regularly for them to be effective and the freehub assembly will certainly need stripping and cleaning if you are riding in particularly wet and muddy conditions. When cleaning a very muddy bike any garden hose is capable of driving dirt into the freehub through the seals if it is directed directly at them. I appreciate your cassette nut had shed its thread but the most likely reason that happened was the hub or freehub bearing seizing.
So removing the cassette and freehub and hub axle in order to inspect clean and regrease everything now needs to be part of your regular maintenance routine.