Prophet Malachi wrote in an age of spiritual abasement, though his collocutors were – formally - ‘the people of God’. Through him, IEUE gave a stern warning to Israel (see, for example, the final and direct words of Malachi’s book [4:6]).
Along with other transgressions, in the days of Malachi many Jewish husbands were 'dealing treacherously' with their wives, divorcing them on all kinds of grounds, getting out of their way the wives of their youth, maybe to marry younger, pagan women (2:11). According to the Theological Wordbook of the Old Testament, the Hebrew word rendered ‘deal treacherously’ (Jewish Publication Society = JPS) means ‘deal deceitfully, (deal) unfaithfully.’ At Psalm 59:5, a participle form of this verb is rendered ‘traitors’ (JPS).
And, as usual, those people believe that they could shut God’s eyes to this behaviour of them through some offerings, or gift, to Him. Obviously, IEUE was not allured by those offerings, so to not see what those men had in their hearts (2:12-13). A spiritual chronic problem of Israel was the inclination to acculturate itself to the peoples around him, leaving the perfect Law of the Creator and the privilege to be His people. Then, in Malachi’s time the nation was again in danger of religious contamination.
So, what about the first ‘spirit’ (רוח) mentioned in the verse 15?
Probably, that ‘spirit’ is God’s holy spirit, which he had poured out on the nation. The disobedient Israelites, however, were resisting, and hence grieving, that spirit (Isa 63:10; Act 7:51-53; compare Eph 4:30.). Some individual Jews were loyal to God’s laws, and by their obedience they had retained what was ‘the remnant of the spirit’ (Darby).
Again, what about the ‘seed (זרע) of God’ mentioned in the same verse?
We may find a clue about the meaning of this expression in Ezra 9:2 (bold is mine), where we read that the Israelites “have taken of their daughters for themselves, and for their sons: so that the holy seed (זרע) have mingled themselves with the people of those lands: yea, the hand of the princes and rulers hath been chief in this trespass.” (Webster)
So, this ‘seed’ was – with high probability - the nation of ancient Israel, which Malachi said was created by God (Webster). This ‘creation’ occurred when IEUE drew the Israelites into a covenant with him at Mount Sinai, making them his ‘own treasure from among all people’, and a ‘holy nation’ (Exo 19:5-6, Tree of Life Version). Moreover, we cannot be neglectful of the additional fact that the true ‘seed’ of Abraham that would bless people of all the earth was to come through this nation (Gen 22:18; Mal 2:10).
And, in conclusion, what about the second (last) ‘spirit’ (רוח) mentioned in the same verse?
First, we can distinguish this ‘spirit’ from the first ‘spirit’ mentioned in the same verse because we find the possessive adjective particle (in a suffix form) ‘your’ (כם-) [in the second person, plural, masculine], included in the composite Hebrew term ברוחכם.
So, it wasn’t the spirit of God – in that case the prophet could say ‘my spirit’ (referring to God). In this case, IEUE warns the individual married male of Israel to attend, or, guard, their individual ‘spirits’ (what urges men - in their own minds - to act in a particular way) about this matter. Adam Clarke commented: “Take heed to your spirit - Scrutinize the motives which induce you to put away your wives”.
I hope this information will be useful for you.