it arguably still is. The primary unit of production of the jobs of mathematicians is itself not particularly useful for society. In this sense funding them is a jobs program. It is also true that they occasionally produce things of great value, and more frequently the things they produce can be leveraged by other researchers to directly produce things of value. But neither of these are what the job of a mathematician is (either in a day-to-day sense, or even for many mathematician's careers).
To go back to the analogy of jobs programs for alcoholics, it is somewhat similar if there was a small chance every time an alcoholic defecated in public gold came out. This fact might be used to support a jobs program for alcoholics, on the basis of it being positive ROI to society. At the same time, the "job" any individual alcoholic is doing in this setup is not particularly useful to society, so one might still call it a jobs program.
To go back to the analogy of jobs programs for alcoholics, it is somewhat similar if there was a small chance every time an alcoholic defecated in public gold came out. This fact might be used to support a jobs program for alcoholics, on the basis of it being positive ROI to society. At the same time, the "job" any individual alcoholic is doing in this setup is not particularly useful to society, so one might still call it a jobs program.