In a square bubble, the soap film get attached tightly through all the six sides of the cube. This creates one centre bubble with the help of many bubbles surrounding it. The bubbles surrounding on the side pushes against the centre bubble.  Finally, the pressure from surrounding bubbles give corners and sides to the square bubble.