Since the spinbox read and write the DPI value "as is", without performing any format change, there's no need to set a stepsize of 24.
As reported here, xdpyinfo, xrdb and fontconfig does not expect values multiple of 24 and sometimes the proper DPI value is an unsigned integer different than the default 96, to be manually calculated because xorg can't auto determine it correctly (see here).