The pixels aren’t being stretched, they are being squashed.
When the backbuffer and the window are not the same size the image will be rescaled upon presenting, which is what is happening here.
Most likely you set the window to 640-480 and you set the back buffer to the same value without taking into account the borders (hence it is squashed more vertically than horizontally, as vertically you have extra window border spent on the title bar).
The client area of a window will be smaller than the actual window size. Your back buffer must be the same size as the client rectangle to avoid scaling.
If you want the client area to be 640-480, adjust the window size using AdjustWindowRect().