Foam machines are used for two primary purposes: generating foam for entertainment, such as at parties, concerts, and festivals to create a fun atmosphere, and for industrial applications like applying polyurethane foam for insulation in construction and packaging.