Elon Musk also posted the image of Starship fuel header tank.
A simple cylinder with flat circular sheets at both ends is less stable and would be heavier than a cylinder with hemispherical or elliptical ends.
A sphere has the best ratio of volume to surface and also of mass to volume. Material stress caused by internal pressure is homogenusly distributed over the surface.
If a sphere's diameter is too big for the rocket, a (short) cylinder with hemispheres at both ends is the second best optimal form. But for the cylindrical part stress in axial direction is only half of that in tangential (circumference) direction.