Context. The distance of the very young open cluster Westerlund 2, which contains the very massive binary system WR 20a and is likely associated with a TeV source, has been the subject of much debate. Aims. We attempt a joint analysis of spectroscopic and photometric data of eclipsing binaries in the cluster to constrain its distance. Methods. A sample of 15 stars, including three eclipsing binaries (MSP 44, MSP 96, and MSP 223) was monitored with the FLAMES multi-object spectrograph. The spectroscopic data are analysed together with existing B V photometry.Results. The analysis of the three eclipsing binaries clearly supports the larger values of the distance, around 8 kpc, and rules out values of about 2.4−2.8 kpc that have been suggested in the literature. Furthermore, our spectroscopic monitoring reveals no clear signature of binarity with periods shorter than 50 days in either the WN6ha star WR 20b, the early O-type stars MSP 18, MSP 171, MSP 182, MSP 183, MSP 199, and MSP 203, or three previously unknown mid O-type stars. The only newly identified candidate binary system is MSP 167. The absence of a binary signature is especially surprising for WR 20b and MSP 18, which were previously found to be bright X-ray sources. Conclusions. The distance of Westerlund 2 is confirmed to be around 8 kpc as previously suggested based on the spectrophotometry of its population of O-type stars and the analysis of the light curve of WR 20a. Our results suggest that short-period binary systems are not likely to be common, at least not among the population of O-type stars in the cluster.