There are exactly three regular polygons that can tile a plane without gaps: equilateral triangles, squares, and regular hexagons. Bees chose the regular hexagon among these because it uses the least wall material (wax) to enclose the same area. Compare them yourself.
Why are hexagons advantageous? All three shapes can tile a plane, but for the same area, the hexagon has the shortest perimeter (the closer a shape is to a circle, the shorter its perimeter, and the hexagon is the closest to a circle among the three). In a honeycomb, walls are shared between neighboring cells, so shorter walls save wax.