Тому не надо было этого говорить.

I’m having trouble understanding why the imperfective “говорить” is used here and not the perfective “сказать”. Presumably this sentence is referencing something specific that Tom said, as a “one and done” thing, so why is the imperfective used?