The purpose of flattening cardboard boxes is to maximize available space in containers and trucks, as well as save time during the sorting process.