Boromir is, well, complicated. He is definitely a loyal member of the Fellowship and he loves his home in Gondor. And he's always willing to lend a hand to help out the other guys. But at the same time, he seems to be kind of a jerk. He's awfully proud of his manliness and his Gondorian origins, and he really starts to get squirrelly in Lothlórien, when he assumes that Galadriel is a witch trying to tempt him. When Boromir sails down the River Anduin with the Fellowship, he appears distracted and all too interested in Frodo. And things definitely come to a head at Amon Hen, when Boromir follows Frodo into the woods and tries to take the Ring from him. He feels bad about it right after, and he rushes to tell Aragorn that Frodo has disappeared, but the damage has been done.
We know from Boromir's first appearance at the Council of Elrond what his flaws are. He comes to tell the Council of a strange dream that his brother, Faramir, has been having for ages. Boromir has also had the dream once, but it’s mostly Faramir’s dream. It starts out with a storm, and then a voice cries out:
Seek for the Sword that was broken:
In Imlandris it dwells;
There shall be counsels taken
Stronger than Morgul-spells.
There shall be shown a token
That Doom is near at hand,
For Isildur's Bane shall waken,
And the Halfling forth shall stand. (2.2.50)
(FYI: Imlandris is the elvish name for Rivendell; Isildur's Bane is the Ring. The Sword that was Broken is Elendil's sword Narsil, which Aragorn carries.) Boromir responds to this dream by insisting that he be the one to go to Rivendell, even though he only has the dream once. Basically, Boromir is extremely arrogant: he believes totally in his own strength, and he doesn’t trust anyone else to do the job of Ring-bearing properly. The fact that Boromir pushes aside Faramir because he wants to go to Rivendell indicates not only his strength and courage, but also his pride and his love of glory.
What's more, Boromir's loyalty to Gondor, while a good thing by itself, also leads him to neglect or ignore everything that does not directly tie to Gondor's happiness and safety. He wants to make Gondor strong again, a desire that the Ring quickly twists.
When Boromir loses his cool and goes after Frodo, he mutters, "What could not a warrior do in this hour, a great leader? What could not Aragorn do? Or if he refuses, why not Boromir? The Ring would give me power of Command. How I would drive the hosts of Mordor, and all men would flock to my banner!" (2.10.36). He wants to claim the Ring to drive away the troops of Mordor from Gondor. But that’s not all he wants to do; he also wants to be king so that he can boss around the whole world.
Not only is Boromir a moral lesson in the dangers of getting too full of yourself, especially if there's a nasty Ring nearby, but he also provides an important foil to Aragorn. We get into this more in the "Character Role IDs" section on "Foils," so for now, we will just say that Boromir's example proves that if you want to rule other people, you probably should not have the power to do so.
It’s actually really sad, if you stop to think about it. Boromir starts out The Fellowship of the Ring as a good guy. Maybe he is a bit pushy and selfish, but he is not a monster. We are sure that, if the Boromir we meet in Rivendell could see what he becomes at the end of The Fellowship of the Ring, he would be horrified.
What brings out Boromir’s worst side is the Ring. After all, this is what the Ring does: it uses people’s desire for power and glory to manipulate them into evil. Remember the nine Rings of Power that Sauron gave to those nine human kings back in the day? They turn into Ringwraiths thanks to this kind of manipulation. Boromir takes his honor very seriously. The fact that he finally turns against a Hobbit he has sworn to protect is all the proof we need of the power of the Ring to drive people crazy with desire.
Boromir’s example proves that it is actually beyond the power of mortals, even well meaning and honorable mortals, to resist the Ring’s influence. Frodo has shown that he is stronger than most against the influence of the Ring, but it is only a matter of time before the Ring begins to twist Frodo as well.