The butter was probably too soft or melted. Use room-temperature butter and be sure to chill the dough before baking to help keep the consistency. You can also try using a cookie scoop to get that perfect cookie shape.