Context : The circumstellar environment of Herbig Be stars in the far-infrared is poorly characterised , mainly because they are often embedded and rather distant . The analysis of far-infrared spectroscopy allows us to make a major step forward by covering multiple rotational lines of molecules , e.g . CO , that are useful probes of physical conditions of the gas . Aims : To characterise the gas and dust in the disc and environment of Herbig Be stars , and to compare the results with those of their lower-mass counterparts , the Herbig Ae stars . Methods : We report and analyse far-infrared observations of two Herbig Be stars , R Mon and PDS 27 , obtained with Herschel ’ s instruments PACS and SPIRE . We construct spectral energy distributions and derive the infrared excess . We extract line fluxes from the PACS and SPIRE spectra and construct rotational diagrams in order to estimate the excitation temperature of the gas . We derive CO , [ O I ] and [ C I ] luminosities to determine physical conditions of the gas , as well as the dominant cooling mechanism . Results : We confirm that the Herbig Be stars are surrounded by remnants from their parental clouds , with an IR excess that mainly originates in a disc . In R Mon we detect [ O I ] , [ C I ] , [ C II ] , CO ( 26 transitions ) , water and OH , while in PDS 27 we only detect [ C I ] and CO ( 8 transitions ) . We attribute the absence of OH and water in PDS 27 to UV photo-dissociation and photo-evaporation . From the rotational diagrams , we find several components for CO : we derive T _ { rot } 949 \pm 90 K , 358 \pm 20 K & 77 \pm 12 K for R Mon , 96 \pm 12 K & 31 \pm 4 K for PDS 27 and 25 \pm 8 K & 27 \pm 6 K for their respective compact neighbours . The forsterite feature at 69 \mu m was not detected in either of the sources , probably due to the lack of ( warm ) crystalline dust in a flat disc . We find that cooling by molecules is dominant in the Herbig Be stars , while this is not the case in Herbig Ae stars where cooling by [ O I ] dominates . Moreover , we show that in the Herbig Be star R Mon , outflow shocks are the dominant gas heating mechanism , while in Herbig Ae stars this is stellar . Conclusions : The outflow of R Mon contributes to the observed line emission by heating the gas , both in the central spaxel/beam covering the disc and the immediate surroundings , as well as in those spaxels/beams covering the parabolic shell around it . PDS 27 , a B2 star , has dispersed a large part of its gas content and/or destroyed molecules ; this is likely given its intense UV field .