There are many puzzles, games, and obsessions that require the creation of new mathematics to understand properly, and then which eventually prove to be useful.
Sometimes solving these sorts of problems requires pushing the boundaries of existing techniques, sometimes the techniques required are completely new and are invented specifically for the question at hand.
I'm not sure about this specific instance with regards payment, but sometimes people are paid to play with these sorts of things simply because you don't know what will come from it.
People constantly, constantly ask this question - "What's the point of pure research?" The question has been discussed many, many times over, and there are eloquent and robust defences for pure research to be found in many places. There's no way I could do better than some of the things already out there, so I won't try. However, many of the things you use today and take for granted for first created by people "playing," sometimes in their spare time, sometimes in time paid for by companies (and in some cases individuals) who were willing to let people play and see what came of it.
If we knew what we were doing, it wouldn't be called "Research."