How do I set the origin to the center of a mesh?
Because your mesh is fatter at the bottom than it is at the top, the center of of mass by volume and by surface are toward the fatter end of your mesh.

Your best bet is to position your 3D cursor where you want your origin to be, and then set the origin to the 3D cursor.


In Edit Mode, select one vertex on each end of your mesh. In your case this is easy because you have conveniently centered vertices. 
Hit SHIFT + S and choose 'Cursor to Selected'
In Object Mode, set the Origin to 3D Cursor.