I can assure everyone, that despite Punjabi being a huge language in Pakistan, almost everyone from all parts of Pakistan speaks Urdu. I don't think Hindi/Hindustani is spoken as much over India, given my prolonged experience with Gujaratis (outside of Ahmedabad & Baroda), South Indians & other Indians. In fact, I had to learn Gujarati living with my Gujju friends to communicate effectively with them. Only in Madhya Pradesh & a few central Indian states is pure Hindi spoken, most other people speak Hindustani.
Anyways, some cities in Pakistan, such as Lahore & others played a very important in the development of Urdu language over centuries. Even if it might not be everyone's first language, it is spoken & understood by almost all Pakistanis. Urdu is spoken because people in Pakistan are proud of their national language, & speak with each other in it, even when they speak in other languages at home & are proud of their regional language. I've met Gujarati people here, & almost all of them are extremely poor in Hindi, & cannot live anywhere with people other than Gujjus, or get out of their Gujju circle. Outside of Pakistan, Pakistanis call themselves Pakistanis, not their ethnicity. Most Pakistanis don't even care or bother to find out what ethnicity the other person is, being Pakistani is just fine for them. Outside of India, Gujaratis call themselves Gujaratis first, Punjabis call themselves Punjabis first, Tamils call themselves Tamils first etc. In Pakistan, national identity is more important than ethnic identity, even though ethnic identity is important to all, & cherished by all. Most regional languages are written in Urdu script as well.