The problem that is happening is that you have scaled it simply by pressing S .
This is happening because while doing rotation, moving or scaling , blender considers the originorigin
of the object as the pivot pointpivot point
for doing all the manipulations.
If you are wondering how the origin ( the one yellow point shown while selecting an object ) got away from the object's geometry you might have moved the object in the edit mode. Remember that while in edit mode no matter whatever manipulations you do, the origin won't move along with the mesh as in edit mode. To solve your problem you can simply scale it on the y axis by pressingS + Y .The proper way to do it is by going to object > set origin > origin to geometry and then scale it by just pressing S