So they vexed his holy spirit; that doesn't mean they had the holy spirit. David was anointed with the holy spirit, but he was an exception. He was a type of the salvation that was to come. The giving of the spirit, as opposed to the giving of the law, was obviously a new thing that GOD was going to do as announced by the prophets.
When someone receives a gift, they have what they have been given. Until Pentecost, the Israelites weren't anointed with the holy spirit because they hadn't been given the spirit; they were given and had law. So they did not have the spirit. If Israel had the spirit before Pentecost, there is no reason for John to have wrote:
By this we know that we reside in him and he in us: that he has given us of his Spirit. 1 John 4:13
And the one who keeps his commandments resides in him, and he in him. And by this we know that he resides in us: by the Spirit whom he has given to us. 1 John 3:24