Why are there 3 lobes in the right lung and 2 in the left? What is the purpose of these lobes?
The Lobes are just differential parts of the overall lung structure.
There is no specifically known reason for the lung structure - just as we do not know why we have five digits instead of three or four, or six! Speaking as an engineer, The lobes themselves are structurally a way to distribute the mass and function of the lungs so that a catastrophic failure to one part may not necessarily destroy the entire organ.
The left is smaller - most likely to accommodate the heart, as shown in some of the charts description of a specific "cardiac notch". This is also noted in the first reference as containing a very small version of the middle lobe of the right - the Lingula. Thus, there is only room for two lobes. The heart is in the volume on the left that is occupied by the Middle Lobe on the right.
Excellent interactive graphics and descriptions here:
D/l slide show here: