What is the exact purpose of this 2.2kOhm resistor in the circuit?
What is the exact purpose of this 2.2 kOhm resistor in the circuit?
  [...] is it absolutely necessary to be there and why exactly?


Its purpose is to form a voltage divider with LDR (photoresistor). The resistance of LDR varies with the light intensity. The resistor turns the variable resistance into a variable voltage, which is then compared to a reference voltage that you can control with the potentiometer.

Yes, it's necessary in this circuit, and most other circuits using an LDR.


  Why is the voltage dropped to 5V in the beginning of the circuit, wouldn't it work if it remained 9V?


You're right here. Due to the circuit's construction of only relying on the relative resistances, the circuit would work fine (even better) without the regulation. You would only have to change the resistor after the LED, because the output from the operational amplifier will be closer to 9 volts than 5 volts.

One minor benefit of having a 5 volt regulation is that you will only get at most 5 volts out of the operational amplifier. This could be useful if you want to connect it straight to a digital input.

Note that the μA741 amplifier chosen here is a pretty bad choice, but why it is so is another question.