Very good question to which the answers are complex and many have been either mentioned directly or eluded to elsewhere in the replies.
Cetane is essentially the opposite of Octane. A higher Cetane rating indicates the fuel is MORE easy to ignite (called "autoignition") while a lower cetane rating is more difficult to ignite. So, within limits, higher IS better as it will provide easier cold starts, more accurate timing and a more complete burn (less soot and smoke).
Higher octane ratings indicate a greater RESISTANCE to autoignition and in most cases a slower reaction rate which actually produces lower engine output when used in an engine not designed for it.
In the USA, most diesel fuel is formulated to ASTM9751 (ASTM 975, 975-1, 9751 are often incorrectly used to mean the same standard). The fuel with which every engine manufacturer must certify their products for emissions is NOT the ASTM standard diesel but "test fuel" that is higher in quality than can be purchased bulk anywhere in the USA. The quality gap between ASTM975 and EPA test fuel was allegedly reduced by a large margin with the intorduction of ULSD in late 2006/early 2007 for 2007 USEPA "on-road" emissions. ULSD is to diesel what Unleaded gasoline is to a typical gasoline engine, I prefer to call it "Unsulfured Diesel", even though there is a small amount of sulfur remaining.
Because of the low quality of the "base stock" used in the USA for diesel (as others have correctly illuminated), it is generally true that higher cetane fuels will have lower specific energy per gallon. This is not a feature of diesel fuel, but of the cheap base stocks used for crude in the USA and the amount of "work" it takes to refine it that causes additional cetane rating reductions.
Now, there is Cetane Index and Cetane Number, they are not the same measure. As with gasoline, you have Pump (motor) and Research octane ratings, this is why you see the "R+M/2" on your gas pump. The octane rating displayed represents the AVERAGE of the Research and Motor octane ratings. There is no analogous pump rating system for diesel in the USA, which in my view is criminal. Believe it or not, different engine designs and control strategies respond to research and motor octane in different ways. Some engines perform best and with lowest emissions with high motor and low research octanes and others are the polar opposite. Diesel engines are no different in that respect.
One MAJOR difference is the cetane rating in a diesel has a material impact on emissions. Higher cetane ratings result in lower Particulate matter (PM) and often (but not always) very slightly increased Oxides of Nitrogen (NOx) emissions.
Relatively high cetane ratings result in:
-Accurate injection timing
-More complete combustion
-Lower PM emissions
-Superior cold startability
-Improved "transient" engine response
-Reduced oil contamination
-Often show a very slight positive efficiency benefit
You would be LUCKY to find diesel in most areas during the majority of the year that will actually meet ASTM975 (40 cetane min) unless it has a significant bio fraction because neat (pure) biodiesel is VERY high in cetane.