Why do chunks of aircraft debris float?
Lighter materials such as plastic will naturally float.

Composites can have large sections of honeycomb core with trapped air. Even if these parts are broken, the honeycomb is sealed against both sides of the panel, still trapping air.

Large sections, whether made from composite or metal, will generally be hollow to save weight, and sealed to prevent collecting moisture which could cause corrosion. There may be small drain holes, but they wouldn't be enough to cause significant leaks.

Fuel tanks are sealed but they are also fairly large and contain baffles to allow fuel to flow within the tank. As you would guess, a catastrophic crash would be unlikely to leave a significant portion that doesn't contain holes.

The parts found suspected to be from MH370 all have these qualities.