There’s a couple reasons.
First and foremost, money. While the residents themselves don’t pay feudal taxes (or sometimes fewer of them, or only to the liege lord rather than the whole chain of subinfeudation), the people who travel to the town aren’t afforded the same luxury. And since cities are hubs for trade, there’s a lot of money to be made from import duties, port fees, warehousing fees, and other taxes.
Second, goods and services. Aside from your village blacksmiths or village carpenters or whatever, the vast majority of peasants are engaged in the production of agricultural goods and other raw materials. Cities, on the other hand, is where you get specialized manufacturing on larger scales – textiles, metalworks, glass, etc. A domestic source for these kind of goods means that it’s cheaper to get those kinds of goods for yourself, and it means a more favorable balance of trade for the goods you can’t get at home. So to put your military cap on for a minute, if you’re trying to equip an army, cities with their more advanced economies are invaluable.
Third, political organization. While this is potentially a double-edged sword for feudal lords, one of the advantages of having cities is that they govern themselves to some extent. This means that the lord, who already has to administer a fief with an extremely limited staff, doesn’t have to spend time governing them and has someone on the ground they can turn to enforce laws for them. For example, you’re probably going to be able to raise more in taxes (or payments in lieu of taxes) than you would from the peasants under your own control and with less effort, because people are more willing to pay when they’re taxing themselves. Likewise, a city or town militia means higher-quality infantry – at the very least, you know they’ve done some drilling and have standard equipment – than your standard peasant levy.