What could be causing my sewing machine (Singer 3223) to be sewing zig zag rather than straight?
It could be the fabric and needle match. Are you using knit fabric with a knit needle? Are you using woven fabric with a sharp needle for wovens? 

Check the manual: https://res.cloudinary.com/singer-sewing/image/upload/v1572776978/Singer-Website-Library/Manuals/Products_manuals/SINGER_3223_and_3229_Sewing_Machine_xresjx.pdf

If the issue is more like “loose stitches” the needle/fabric/thread combination can be the issue. 
Have you checked the needle size with the type of fabric? 
Otherwise, hopefully it’s still under warranty and you can get a replacement or have it adjusted.