What really causes this problem is that the ball hits one of the paddle's sides (or corners) and the bottom of the ball actually passes the top of the paddle.
let's call the distance between the bottom of the ball and the top of the paddle x
. at this point, a collision with the paddle is detected and the ball goes up with a velocity on the y-axis whose absolute value is < x
(i.e., |yVelocity| < x).
so even though the ball went up, technically it's still colliding with the paddle (it may be hard to notice). in the next iteration another detection with the paddle is detected (since the ball is still colliding with the paddle) so the ball goes down again.
this process keeps repeating until the ball is not colliding with the paddle anymore. here are some visualizations:




To fix this, you may handle collision with the paddle in such a way that
if the ball is going down
bounce the ball off
This will simply ensure that whenever the ball hits the paddle, it will never go down again.
Update: If you're trying to make the ball bounce off horizontally when it touches the left/right sides of a brick, I prefer separating the conditions. This probably makes code easier to read and keeps some logical problems away. Assuming the height of my ball > the height of my bricks, the pseudocode might be something like
// if the ball is adjacent to a brick horizontally
if ball y < brick y AND ball bottom > brick y
change the velocity of the ball on the x-axis
else if ballY < brick bottom AND ballBottom > brick bottom
change the velocity of the ball on the x-axis