why did they choose to keep the British monarchy as part of their political system compared to countries like India and Pakistan where they no longer considered a constitutional monarchy
I'm going to answer for Canada, because I'm Canadian and have more knowledge on the subject.
Before getting into it, and addressing countries like India and Pakistan, India was a pre-established country with thousands of years of history, infrastructure, culture and peoples that pre-dated the British empire by quite a lot. They were/are very different from the British and when the British colonized, they were treated as second-class citizens. So when they gained independence (which was also a more difficult independence compared to Canada - which I'll get into), they had no interest in staying "British".
When it comes to Canada, firstly, I acknowledge the presence of native populations, however the low populations, compounded by high death rates after initial contact meant that the majority of the Canadian population consisted of British (& French who arrived pre switchover) citizens. The natives were treated as second-class citizens, but were a VAST VAST minority compared to the amount of British immigrants who had colonized who felt loyalty and family ties to the motherland. So when the time came to separate, there was a massive amount of loyalty still felt towards the Crown by Canadians.
It's also worth noting the difference between Canada and India when separating. India's independence was hard-won and left the Indians with a sour taste in their mouth and resentment. However, when it comes to Canada, confederations was supported by the British for many reasons, one of them being that they wanted (basically) a vassal state, but one that was a little bit more self-supporting. For a while after confederation (1867), Canada was still a colony, but a self-governing one. Slowly for the next century, Canada gained more and more independence bit by bit without major uprisings or violence, to today where the British monarch still is our head of state, but has in all practicality, no power. She has a representative in our country who must sign off on all bills, but mostly serves in a figurehead role.
TL;DR -
Canadians were mostly of British origins + peaceful and gradual independence was earned = loyalty and traditional appreciation for role of monarchy still alive and well
Indians were a large existing population with very few British immigrants + strained relations and rebellious independence = resentment towards Britain and no desire to keep monarch (although still part of commonwealth)