Thats actually why Pizza places are so successful and widespread. The profit margins for pizza is way more than other fast food.
Pizzas are mostly cheap ingredients of bread, tomato and cheese. With a small quantity of expensive ingredients as toppings.
While burgers and such have an expensive ingredient like beef as the main component.
Honestly though, there are like 3 examples of pizza with expensive toppings, like buffalo mozzarella or some shit, but even then, the amount they put on your pizza is nowhere near what they pay.
Burgers though? Let's see, I'd pay about 10 euros for a kg of beef? I can make about 4 paddies if I want to be extremely generous to whoever eats. 2.5 euros for the beef paddies, the rest is just flour, milk, butter, eggs (mayo), oil, vinegar (pickles), some fresh vegetables and I'm done. The only limited ingredient here is the meat, the others will be abundant and reusable for more than 4 paddies. Considering it's about 6 euros for a hamburger...