Context. BL Lacertae is the prototype of the blazar subclass named after it. Yet, it has occasionally shown a peculiar behaviour that has questioned a simple interpretation of its broad-band emission in terms of synchrotron plus synchrotron self-Compton (SSC) radiation.Aims. In the 2007-2008 observing season we carried out a new multiwavelength campaign of the Whole Earth Blazar Telescope (WEBT) on BL Lacertae, involving three pointings by the XMM-Newton satellite in July and December 2007, and January 2008, to study its emission properties, particularly in the optical-X-ray energy range.Methods. The source was monitored in the optical-to-radio bands by 37 telescopes. The brightness level was relatively low. Some episodes of very fast variability were detected in the optical bands. Flux changes had larger amplitude at the higher radio frequencies than at longer wavelengths.Results. The X-ray spectra acquired by the EPIC instrument onboard XMM-Newton are well fitted by a power law with photon index Λ ∼ 2 and photoelectric absorption exceeding the Galactic value. However, when taking into account the presence of a molecular cloud on the line of sight, the EPIC data are best fitted by a double power law, implying a concave X-ray spectrum. The spectral energy distributions (SEDs) built with simultaneous radio-to-X-ray data at the epochs of the XMM-Newton observations suggest that the peak of the synchrotron emission lies in the near-IR band, and show a prominent UV excess, besides a slight soft-X-ray excess. A comparison with the SEDs corresponding to previous observations with X-ray satellites shows that the X-ray spectrum is very variable, since it can change from extremely steep to extremely hard, and can be more or less curved in intermediate states. We ascribe the UV excess to thermal emission from the accretion disc, and the other broad-band spectral features to the presence of two synchrotron components, with their related SSC emission. We fit the thermal emission with a black body law and the non-thermal components by means of a helical jet model. The fit indicates a disc temperature ≳20 000K and a luminosity ≳ 6 × 1044 erg s-1.