I'm not saying this is part of your situation, since you said the area behind your sprocket was relatively clean this time, but that mess on the gear box cover can also be from a build up of chain lube.
It is odd that the sprocket nut would be loose if it was torqued and locked with the washer...?