At John 16.7 Jesus is recorded as saying this to his disciples on his last night with them;
But what I'm telling you is the truth: it's to your advantage that I go. Because if I don't go, the Comforter won't come to you; but if I go, then I will send him to you (my translation).
Of course he is talking here about the παράκλητος, the Holy Spirit. Why does Jesus say, however, that if he doesn't leave, the Holy Spirit won't come?
One way that I've understood this problem is this. The Israelites had made a covenant with God which contained various stipulations and conditions: they would receive blessing if they obeyed, but they would incur a curse if they disobeyed. Yet at Deut 30, we read that, once all the blessings and curses which the covenant described had fallen upon them, if they would repent, they would be restored in various ways:
When all these blessings and curses I have set before you come on you and you take them to heart wherever the Lord your God disperses you among the nations, and when you and your children return to the Lord your God and obey him with all your heart and with all your soul according to everything I command you today, then the Lord your God will restore your fortunes and have compassion on you and gather you again from all the nations where he scattered you (Deut 30.1-3).
Now, there is one promise which is particularly intriguing. It says:
The Lord your God will circumcise your hearts and the hearts of your descendants, so that you may love him with all your heart and with all your soul, and live (v. 6).
I understand this circumcision of the heart to refer to the new birth and the baptism of the Holy Spirit, such as the apostles experienced at Pentecost. It means a fundamental transformation of the human person into such a state as gladly obeys the law of the Lord and lives in fellowship with him.
It is important to remember, however, that this blessing comes upon repentance, as shown in vv. 1-3. Insofar as the paradigmatic description of the curse of the Law is social turmoil and oppression at the hands of foreign rulers (cf. Deut 28), we may reasonably say that Israel in 1C Palestine under Roman rule was still cursed. In fact Paul goes on to say that they are still under their curse insofar as they reject Christ (Gal 3.10). Evidently, then, an adequate and true repentance was not forthcoming.
Jesus Christ, however, in his participating in the national repentance to which John called Israel (see Mark 1.4-11) can be understood as offering up this repentance on their behalf. He fulfills the stipulations of the covenant (cf. Mt 5.17) and even offers himself to die the accursed death of the Law in the place of all (cf. Gal 3.13). Thus because he obeyed the covenant, because he offers that repentance for which the Law called, he receives the promised Holy Spirit and gives it to all who come to him (Acts 2.33).
So the curse of the Law has been exhausted, the obedience required has been offered, and the promised Holy Spirit is available to all who come to Christ! It was truly to our advantage that he go.