The zigzag stitch allows you to space the stitches further apart in the cloth, for the same number of stitches per inch of sewing. Or, to put it another way, you get the best overall strength, with the stitches passing through the cloth as many times as possible, but without weakening it. If you use straight stitch, with the stitches close together, you are perforating the cloth too much and tend to get a "tear along the dotted line" effect. A zigzag machine can do straight stitch as well, so is more versatile.
Also, when you make a mistake, it's much easier to pass a seam ripper along a line of zigzag sewing!