As in a hadith the prophets advised us to follow up a bad deed with a good one, so that the good deeds nullify / reduce the effect of that bad deed. Allah knows BEST!
A bad deed cannot equate one good deed, right ? On a practical level we are all humans and not free of temptations and can go stray in a jiffy.
But since We do not know how big a bad deed is , what punishment it carries, on the flip side we do not know how much reward a good deed carries , so I guess many many good deeds have to follow one single bad deed no matter how trivial this bad deed seems to be. Better safe than sorry people should strive to lead sin free lives.