looping error

Also, here when i have created a WHILE loop saying to loop while the pushbutton is high, why doesn't it stop once the switch goes LOW

It does.

. I had to create another IF condition inside the WHILE loop to check if pushbutton goes low

I can't see your before code, or your serial output, or any proof that the switch is wired correctly. The if statement in the while loop does not cause a break out of the while loop, so that should be adequate proof that the while loop does end when the switch state is no longer HIGH.

It appears, though, that you expect the body of the while loop to not be executed, if, after entering the while body, the exit condition becomes true. That is NOT how a while statement works.