A bench of justices Bhushan R Gavai and KV Viswanathan held that demolitions cannot be used as punitive measures against those accused or convicted of crimes