I think it matters a lot. open legal cases and probable environmental claims (e.g leakage) will affect the future operational cash flow and consequenctly on the firm value. Hard HSE regulation of operation areas of target company will affect costs and future income. Deep sea operation or shalow drilling have different environmental risks and different points of view about probable contigent risk cost.
To me, environmental DD certainly matters especially when acquiring companies with large real estate portfolio. The buyer does not wish to end up with properties that see its valuation drop due as it does not meet certain green certifications requirements.