It has many functions. One is to change the saturation dynamics of the heme group. It gives rise to the complicated Bohr effect, which allows erythrocytes to release oxygen at a rate more suited to the needs of a tissue. For example, tissue that suffers from anoxia begins fermentation to provide energy, which releases protons (acid). This acidification would go unnoticed by the heme, but the protons bind to the globin chains and cause it to release oxygen, compensating for the reduced oxygen levels in the tissue.
Also, the globin chains form a quaternary structure, which allows subunit cooperation. This allows the oxygen-binding curve to be sigmoid instead of hyperbolic (see
https://en.wikipedia.org/wiki/Oxygen-hemoglobin_dissociation_curve).
CO2 is also carried (at a low rate) by the globin chain. When CO2 is bound to globin, it is turned into carboxyhemoglobin, which stimulates the release of oxygen.
Cells release a metabolite called BPG when oxygen levels are low. BPG binds to the middle of the four globin chains and pulls them together (globin is positively charged in that area, while BPG is negatively charged), stimulating even more oxygen release.
NO (nitric oxide) binds to heme with an affinity 10,000 times that of O2 (compare that with CO's affinity of about 200 times). But blood vessel epithelial cells release NO to act as a paracrine signalling molecule (to cause dilation). The globin chains prevent NO from interacting with the heme, and also carries the NO safely.
CO binds with an affinity to heme significantly more than oxygen (I forget the exact amount, but I think it was 2,000), but the globin chains make it a difficult fit for CO, reducing the affinity to 200 times that of oxygen to prevent the low levels of CO released during metabolism from reaching poisonous levels. A histidine reside (histidine in myoglobin, at least) forces the CO to assume a 120 degree angle with the plane of the heme. This makes CO "uncomfortable", as its optimal binding angle is 90 degrees. O2 is not restricted, however, because its optimal binding angle is already 120 degrees.
The globin chains also function to prevent the iron in the heme from being oxidized by the O2 it needs to carry.
There are actually a lot of other functions than I described, but I don't want to get too detailed. The functions of the globin chains are extremely complex.
In summary, the globins' function to adjust the affinity of heme for oxygen dynamically so that it better suits the needs of surrounding tissues. It does this through many, many mechanisms.