Think of it this way.
Water under pressure will always take the path of least resistance (don't we all?). If you tap the side of the portafilter, coffe grounds will move away from the sides, creating a weak spot. The water will flow quicker through these weak spots and over extract. It is better not to tap, concentrating rather on getting a nice even tamp through the whole basket so the extaction is even.
Tamp evenly, wipe the rim of the portafilter clean and you shold be right!