No, staying in the NIT Calicut hostel for a PG student is not at all compulsory. The administration will ask you to be available throughout the day on the campus and staying in the hostel comes under the residential program but it's not compulsory. No one can force you to avail of hostels.
Staying in the other hostels or PG would be costlier and the hostels at NIT Calicut are supposed to be cheaper. There are a number of rooms with AC within 150 meters from the campus in or near Koyyapuram Apartments.
Therefore, it depends on your will whether to stay in a hostel or anywhere outside the campus and no one can interfere in your decision.