There are a few possibilities here. One is that you didn't beat the eggs, sugar, and vanilla together properly/for long enough (you really want them to get light and fluffy). Another possibility is that you under-measured your flour and/or used baking soda instead of baking powder. Baking soda will make the cookies spread quite thin.