This can happen if you didn't oil the idli molds before adding the batter to them, or if you undercooked the idli. Make sure you oil the idli molds and to check if the idli is done insert a toothpick and ensure it comes out clean.