The primary reason for the use of trans fats in baked goods is their stability and cost-effectiveness. Trans fats help to maintain the desired texture and extend the shelf life of products like cookies, cakes, and pastries. They are also less expensive than some natural fats and oils, making them an attractive option for food manufacturers.