The flange-focal distance of M42 is 45.46mm and of Nikon F is 46.5mm. Thus, an adapter without glass would have to add no more than 1.0mm of thickness to put a Nikon F lens on a M42 body and retain infinity focus. However, there is also a mechanical constraint. The diameter of the M42 mount throat is relatively small and I think the Nikon lens rear bayonet wouldn't fit inside it (and certainly not when you include the extra material the adapter needs to fit the threads and the bayonet). This is why your adapter is 10mm thick.
Thus, as Paul says, to maintain infinity focus on F-to-M42, one needs an adapter with a glass element. Such adaptors have a weak negative lens to add some extra divergence, allowing the main lens to sit further away and still focus. That also shortens the focal length a little. In principle, the effect of the adaptor does depend a little on the design of the main lens (on the position of the rear principal plane of the main lens), but I don't know if that matters much in practice).
I would have guessed that such adaptors would introduce aberrations, but people seem to be more or less happy with them; I haven't used one. Many happy users may be adapting full frame lenses to APS-C digital cameras, which would have fewer quality issues since they're not using the corners of the field.