You didn't show how you draw your objects, but I would guess you're splitting up your player movement and collision response into separate frames, causing your object to alternate between collision and non-collision each frame. Basically, your logic probably flows something like:
1. Move object
2. Draw frame
3. If object is colliding, move object back.
4. Draw frame
5. Repeat
What you probably want is something more like:
1. Move object
2. If object is colliding, move object back.
3. Draw frame
4. Repeat
By the way, now might be a good time to learn how to use a debugger if you haven't already
. These types of problems are usually pretty easy to spot when using one