This circuit achieves two things:
- the relay is it's powered from +5V and the logic is powered from +3.3V, so level shifting (although there are easier ways in this setup to do it)
- it inverts the signal - when the input signal is low, the relay is on and vice versa.