When driven appropriately (ie - not short town trips, but a healthy dose of motorway driving) they actually are.

The old myth of the "unreliable diesel" does have a source of truth of course, as in the early-mid 2000s when DMFs started being fitted on common cars and later on DPFs they were not doing well on short town trips. Even so, DPF's were hardly a diesel on 6 cylinder engines, mainly due to smarter positioning (always close to the engine) and also because they warmed up quicker. Same with EGR valves, mine were fairly clean on both the M57 and N57 at 100k+ miles and never had an issue. That being said, the old N47 engines with their snapped timing chains were very infamous indeed, and that is for good reason.
"Back in the day" when the comparrison was with a diesel with early stages DMF and DPF, the issues were indeed more likely on the diesels. Add in turbos and injectors and there you go, compared to a NA petrol it was a lot more to go wrong. Modern petrols however also have turbos and DMF's as well and with the improvement of DPFs it's nowhere near as bad as it used to be.
On the other hand, if you you look at modern petrol engines, reliability isn't exactly what it used to be. Whether we're talking epic fails on Ford Ecoboost, snapped chains on 1.4 TSI engines or ridiculous oil consumption on 1.8 TFSI or 2.0 TFSI engines. The supercharged v6 on Audi is a peach of an engine on the other hand.
Overall across all manufacturers the diesels are probably more problematic, especially if not driven in the right conditions. But it's no simple rule for sure, and they certainly need to be taken into account on a case by case basis.
However, a decently maintained M57 or N57 six cylinder is nothing to be scared off, and overall I dare say more reliable than the M54 petrol. I've had all 3 at 100k+ miles and drove 30k+ miles with each across different conditions from central London traffic where I am based to long european trips at Autobahn speeds. The only time I broke down was with a sticking caliper on the F30 330d after changing the rear disc & pads - but that can happen to absolutely any car out there.