This story is problematic for me. Does the Holy Spirit overrule people's will? (I don't think so, but
No, God's Spirit does not overrule people's wills. Evidently, the people whom the Spirit used to prophesy were neither antagonistic to David nor were they antagonistic to God. Even Saul believed in God, despite his backslidden condition. So, then, were Saul and Saul's messengers God's puppets on a string? No.
David, whose righteousness exceeded that of his king, was being supernaturally preserved by God and would be taking Saul's place as king of Israel. For all we know (though the Scripture does not necessarily warrant what I am about to suggest), one theme of the prophecies of God's temporary mouthpieces could have been God's wisdom and grace in choosing and preserving the life of the king-to-be, David.
Another theme may have been the prediction of when and under what circumstances David would ascend to the throne. (The dual function of prophets comprised both the forth-telling of God's message and the foretelling of God's will.)
In conclusion, the story of the prophet Balaam (see Numbers 22-24) is a good illustration of how God's prophets, whoever they may be, have an obligation to prophesy the word of the Lord as it was given to them by God himself (or by the angel of the Lord, who may have been God in human form, as in the incident with Balaam and his donkey in Numbers 22:22 ff.).
Furthermore, God has the right and the authority to inspire whomever he chooses