Why do floating plants have air spaces in their roots, leaves, stems?

Large air cavities provide buoyancy for the leaf. The large intercellular spaces continue into the stem and root and they provide the necessary oxygen to these organs.