What's happening here is that Wave Warp's 'pinning' feature is pinning the edge of the layer - not the flag object. Shape layers have an unusual set up - the shape layer is actually filling the comp space - even though your flag is just a rectangle in the middle. This means the 'left pinning' is having an effect on the left of the composition frame - away from your flag.
Here's how to fix it:
Move your flag rectangle to the extreme left side of the frame - so the left side of your flag sits just inside it.
Set Wave Warp pinning to left.
Now Pre-compose that layer : Layer > precompose.
Now move that precomposed layer back into the position by your flag pole.