Why do metals have a crystal structure if their electrons are delocalized? It is said that metals have an electron structure that is delocalized; their electrons are not strictly bonded to the atoms but rather form an irregular "sea" of electrons. 

I'm studying materials science at the moment and the crystal structure of metals is a large topic. But if the electrons form irregular patterns, how can the metal be a crystal which by definition is a regular structure?
 A: The ions form a regular structure (and they are still holding most of the electrons, only the outermost electrons enter the valence band). The valence electrons form an electron gas in the regular structure set up by the ions.
The electron gas is still a regular structure on average, but the structure referred to is the ion structure.
A: One problem for understanding is the meaning of a delocalized electron. The picture induces to think of well localized electrons (the blue dots), that happens only to be "out of the right place".
It is better to see them as a cloud around the ions. Its exactly that electronic field that holds the ions together at the equilibrium positions of the crystal.   
A: You ask

if the electrons form irregular patterns, how can the metal be a crystal which by definition is a regular

A crystal lattice is a model of what happens in the many body quantum mechanical problem of $10^{23}$ per mole atoms in a solid. It came about because experiments with x-rays showed a regular structure . A mathematical calculation using optics found that the atoms must be at regular lattice positions. That is the basic experimental reason one talks of lattices in solids.
Because it is a many body quantum mechanical problem it is not possible to solve an  equation to describe the behavior of electrons around the nuclei while they are in the lattice, and mathematical models developed to explain how the lattice is bound and how the different measured behaviors of solid materials to conductivity arouse.
When one talks of a single nucleus the  solution of the equations shows that the electrons have probability loci, orbitals, about the common center of mass, which, because the nucleus is so much heavier than the electrons can be taken as the position of the nucleus itself. Thus the models of the nucleus sitting at the stable, found by x-rays, points of the lattice, while the electrons orbit around the positive center, came about. The attraction to become a lattice comes from the spill over points, where the orbitals allow space the positive charged field to be strong , and the atoms bond into a lattice  due to these forces , qualitatively like LEGO.
Quantum mechanical models developed to explain the behavior of solid state. A dominant one, that explains the conductivity in solids quantitatively is the band theory of solids, 


An important parameter in the band theory is the Fermi level, the top of the available electron energy levels at low temperatures. The position of the Fermi level with the relation to the conduction band is a crucial factor in determining electrical properties.

In the image , you show by blue the possible positions of electrons ( probabilistic quantum mechanical) because at the conduction band the electrons are modeled to belong collectively to the lattice, quantum mechanically, in such numbers that the idea of a fermi gas/fluid can be developed. This model does not affect the position of the heavy, in charge and mass, nuclei in the lattice.
So the irregular patterns in your image are because of the probabilistic nature of electron orbitals , but these orbitals to not affect the location of the nuclei in the crystal lattice.
