Above, our Lord consoled his disciples over his leaving by promising that they would be able to approach the Father. But because it might seem that this was in the distant future, and in the meantime they would still be in sorrow without their Teacher, he here soothes their sorrow by promising them the Holy Spirit. First, we see the preparation needed to receive the Holy Spirit; secondly, the Holy Spirit is promised, he will give you another Paraclete. Thirdly, this promise is clarified, to be with you forever. Preparation for receiving the Holy Spirit was necessary both for the disciples and ...for Christ.
The disciples needed a twofold preparation: love in their hearts and obedience in their work. Our Lord assumes they have one of these, for he says, If you love me. And it is clear that you do because you are sad over my leaving: "You also are witnesses, because you have been with me from the beginning" (15:27). The other he commands for the future, keep my commandments. This is like saying: You don't express your love for me by tears but by obedience to my commands, for this is a clear sign of love: "If a man love me, he will keep my word" (14:23). Thus, two things prepare one to receive the Holy Spirit. Since the Holy Spirit is love, he is given only to those who love: "I love those who love me" (Prv 8:17). Likewise, he is given to the obedient: "To this we are witnesses" (Acts 3:15); "I have put my Spirit upon him" (Is 42:1).
Yet is it true that it is the obedience of the disciples and their love for Christ that prepare them for the Holy Spirit? It seems not, because the love by which we love God is from the Holy Spirit: "God's love has been poured into our hearts through the Holy Spirit which has been given to us" (Rom 5:5). Further, our obedience is from the Holy Spirit: "For all who are led by the Spirit of God are sons of God" (Rom 8:14); "I have run in the way of your commandments when you enlarged my heart" (Ps 119:32). One might answer that it is by loving the Son that we deserve to receive the Holy Spirit, and having him, we love the Father. But this is false because our love for the Father and the Son is the same love.
Accordingly, we should say that it is characteristic of the gifts of God that if one makes good use of a gift granted to him, he deserves to receive a greater gift and grace. And one who badly uses a gift, has it taken from him. For we read in Matthew (25:24) that the talent which the lazy servant received from his master was taken from him because he did not use it well, and it was given to the one who had received five talents. It is like this with the gift of the Holy Spirit. No one can love God unless he has the Holy Spirit: because we do not act before we receive God's grace, rather, the grace comes first: "He loved us first" (1 Jn 4:10). We should say, therefore, that the apostles first received the Holy Spirit so that they could love God and obey his commands. But it was necessary that they make good use, by their love and obedience, of this first gift of the Holy Spirit in order to receive the Spirit more fully. And so the meaning is, If you love me, by means of the Holy Spirit, whom you have, and obey my commandments, you will receive the Holy Spirit with greater fullness.
Source: Commentary on John