It was not, it was done illegally by kar sevaks or Hindu nationalists.
To quote directly from the Wikipedia Article
On 6 December 1992, the RSS and its affiliates organised a rally involving 150,000 VHP and BJP kar sevaks at the site of the mosque. The ceremonies included speeches by BJP leaders such as Advani, Murli Manohar Joshi and Uma Bharti. During the first few hours of the rally, the crowd grew gradually more restless, and began raising militant slogans. A police cordon had been placed around the mosque in preparation for attack. However, around noon, a young man managed to slip past the cordon and climb the mosque itself, brandishing a saffron flag. This was seen as a signal by the mob, who then stormed the structure. The police cordon, vastly outnumbered and unprepared for the size of the attack, fled. The mob set upon the building with axes, hammers, and grappling hooks, and within a few hours, the entire mosque was leveled. Hindus also destroyed numerous other mosques within the town.
As the article states "police" were overwhelmed, the Congress government at the time can thus be charged with being "lax" with security at best rather than supporting the demolition, and thus it is not at all a matter of constitutionality since the government attempted at least to uphold the law.