Molasses does contain sugar so it's not healthy in excess just like regular sugar is when consumed in excess.
However molasses does contain important nutrients and antioxidants which makes the molasses a healthier type of sugar than regular refined sugar does.
Because refined sugar does not contain all those nutrients so the molasses is healthier for you than the refined cane sugar.
But molasses is high in sugar content so it can be bad for you in excess so just consume the molasses in moderation and it will be healthier for you than regular cane sugar.