Galatians is one side of a heated argument; a "war of words" that was going on between Paul and "die-hard Jews". And Paul is spitting bullets. When you read it you can feel the heat. The scruff of Paul's neck is up like a mad dog. The Galatians, Peter, maybe some other apostles and perhaps the majority of the Jewish believers in Galatia have moved off center from Paul's teaching and are relying on aspects of Judaism and even insisting the same for gentile believers.
So what seems to be the problem? The central issue seems to relate to this passage:
Gen 17:3 And Abram fell on his face: and God talked with him, saying,
Gen 17:4 As for me, behold, my covenant is with thee, and thou
shalt be a father of many nations [gentiles!]. Gen 17:5 Neither
shall thy name any more be called Abram, but thy name shall be
Abraham; for a father of many nations [gentiles!] have I made
thee. Gen 17:6 And I will make thee exceeding fruitful, and I will
make nations of thee, and kings shall come out of thee. Gen 17:7 And
I will establish my covenant between me and thee and thy seed after
thee in their generations for an everlasting covenant, to be a God
unto thee, and to thy seed after thee. Gen 17:8 And I will give
unto thee, and to thy seed after thee, the land wherein thou art a
stranger, all the land of Canaan, for an everlasting possession; and I
will be their God. Gen 17:9 And God said unto Abraham, Thou shalt
keep my covenant therefore, thou, and thy seed after thee in their
generations. Gen 17:10 This is my covenant, which ye shall keep,
between me and you and thy seed after thee; Every man child among you
shall be circumcised. Gen 17:11 And ye shall circumcise the flesh of
your foreskin; and it shall be a token of the covenant betwixt me and
you. Gen 17:12 And he that is eight days old shall be circumcised
among you, every man child in your generations, he that is born in the
house, or bought with money of any stranger, which is not of thy seed.
Gen 17:13 He that is born in thy house, and he that is bought with
thy money, must needs be circumcised: and my covenant shall be in your
flesh for an everlasting covenant.
Gen 17:14 And the uncircumcised man child whose flesh of his foreskin is not circumcised, that soul shall be cut off from his
people; he hath broken my covenant.
So based on this seemingly impenetrable dictum all of Galatia was abandoning Paul's gospel of justification by faith apart from the activities of the law. The argument seemed to crescendo on the idea of the inheritance of the promise land which verse 14 seems to say will be denied anyone uncircumcised. It seems like they have a very solid case, no?! I think so! Galatians is Paul's counter.
There is another passage that seems to also be being marshaled by Paul's foes:
Deu 6:17 Ye shall diligently keep the commandments of the LORD your
God, and his testimonies, and his statutes, which he hath commanded
thee. Deu 6:18 And thou shalt do that which is right and good in the
sight of the LORD: that it may be well with thee, and that thou mayest
go in and possess the good land which the LORD sware unto thy fathers,
Deu 6:19 To cast out all thine enemies from before thee, as the LORD
hath spoken. Deu 6:20 And when thy son asketh thee in time to
come, saying, What mean the testimonies, and the statutes, and the
judgments, which the LORD our God hath commanded you? Deu 6:21 Then
thou shalt say unto thy son, We were Pharaoh's bondmen in Egypt; and
the LORD brought us out of Egypt with a mighty hand: Deu 6:22 And
the LORD shewed signs and wonders, great and sore, upon Egypt, upon
Pharaoh, and upon all his household, before our eyes: Deu 6:23 And
he brought us out from thence, that he might bring us in, to give us
the land which he sware unto our fathers.
Deu 6:24 And the LORD commanded us to do all these statutes, to fear the LORD our God, for our good always, that he might preserve us
alive, as it is at this day. Deu 6:25 And it shall be our
righteousness, if we observe to do all these commandments before the
LORD our God, as he hath commanded us.
Note that: "It shall be our righteousness".
I won't go into Paul's other arguments for his gospel in Galatians but I will attempt to address your question regarding that particular passage.
Note that he says "though he is an heir", as a child he is no different from a slave in that a slave controls him. Though the Jews were promised to inherit the land, as long as they are under the control of the law being an heir has no practical value. They need to be emancipated.
So the "guardian" was a slave that controlled an heir while they were a child. Paul paints it as a debasing situation, where the child is essentially a slave.
And Paul's argument is that in order to enjoy their inheritance they have to be emancipated from the law, their guardian. And he goes further to say that if they remains slaves by being under the domination of the law that they will not receive the inheritance:
Gal 4:28 So you, brothers, are children of the promise, like Isaac. Gal 4:29 But just as then the son who was conceived according to the
flesh persecuted the son who was conceived according to the Spirit, so
it is now. Gal 4:30 But what does the Scripture say? "Drive out the
slave woman and her son, for the son of the slave woman must never
share the inheritance with the son of the free woman." Gal 4:31 So
then, brothers, we are not children of the slave woman but of the free
So in this chapter Paul is arguing somewhat based on emotion using analogies rather than analysis of the passages set forth. In other places he makes more cogent arguments.