^ It is not part of the Hajj obligation. The total Hajj ritual takes between 4 to 6 days depending on what rituals you perform.
People go to Madinah because it is the second holiest city in Islam. When the Saudi Govt. gives out the Hajj visas the pilgrims are restricted to visiting Just Makkah, Madinah and Jeddah (as it is the closes commercial city to Makkah and the closes Int'l airport is located there) The drive from Makkah to Madinah takes just 2 1/2 hours.
When pilgrims spend a lot of money for the plane ticket, visa fare, board and lodging etc. (many people save all their lives for this opportunity) they want to make the most out of their visit as it may be a once in a lifetime opportunity to visit the Holy Mosque and Grave of our Beloved Prophet (SAW) and other sahabas. There are also many historical masjids that they visit in Madinah, mainly Quba and Qiblatain.
Also prior to 1967, a great many Muslims made it a point to visit Al Aqsa, the third holiest masjid in Islam, upon the completion of pilgrimage in Makkah and Madinah.