The grammar seems okay. The word "it" here is not necessarily taking the place of a noun, which most pronouns do, but it is part of a common expression we use. For example to express what we like we may say... I like it when + (our opinion about something we like)
For example "I like it when you take me out to eat. "Or "I like it when you clean up your room." There could be a million possiblilies using this phrase.