We present the development and performance of an optically detected magnetic resonance (ODMR) spectrometer. The spectrometer represents advances over similar instruments in three areas: (i) the exciting light is a tunable laser source which covers much of the visible light range, (ii) the optical signal is analyzed with a spectrograph, (iii) the emitted light is detected in the near-infrared domain. The need to perform ODMR experiments on single-walled carbon nanotubes motivated the present development and we demonstrate the utility of the spectrometer on this material. The performance of the spectrometer is critically compared to similar instruments. The present development opens the way to perform ODMR studies on various new materials such as molecules and luminescent quantum dots where the emission is in the near-infrared range and requires a well-defined excitation wavelength and analysis of the scattered light.