Why do places charge a delivery fee?
To deliver, a place has to either provide their own cars and hire drivers (not very common) or have the drivers use their own car and pay them a fee for that.
They have two choices of how to cover this cost. They can either charge a delivery fee or add the cost into the price of the pizza. The problem with adding it into the price of the pizza is that it makes that place a lot more expensive than the place that just has pick-up service. Some places do have pick up only specials where they sell the pizza at a cheaper price.
The cost to have delivery service is about as much as the cost of the ingredients in the pizza. Anyplace that tried to absorb that cost without charging the customer would soon go out of business.