The debt-laden company will be making interest payments on the debt over the years. (Preferred stock and convertibles that pay interest should also be considered debt for the purposes of calculating value.) So, even though the two companies have equal market caps, the company with debt is worth more.
FORBES: Using Enterprise Value To Compare Companies