Good and evil in Beowulf relate to the idea of selflessness versus selfishness. Notice how the good characters tend to be generous, community-minded people, like the warrior kings who share treasure with their warriors or Beowulf who helps defend the innocent from the claws of Grendel. Notice how Grendel and his mother, both presented as violent and malignant, are anti-social outside of their interactions with one another. They are threats to the community, which in the poem is presented as the highest good.
The dragon is the ultimate symbol of evil in the poem. It lives alone and hoards treasure for itself, sharing with no one and having no use for the loot. Beowulf is the dragon's opposite, generous and willing to lay down his life to save his people from being destroyed by the monster.
In Beowulf, "good" is connected to valor and duty. Good kings, for instance, reward their vassals generously; Hrothgar is a good king because he entertains well and gives out lots of treasure. Beowulf is a good warrior because of his courage and strength. Grendel is bad because he is not human, and his nightly attacks on Heorat are terrifying but also somehow cowardly, as he murders people in their sleep.
Goodness is also connected in Beowulf with the idea of glory and with stories that will attest to a hero's prowess and make him remembered beyond his death. Unferth, for example, lacks Beowulf's prowess at arms, but, in a way, his attack on Beowulf's character when he questions the story of his swimming contest is more harmful than any combat. Beowulf's retelling of the tale of his defeat of Breca and his battle with the sea monsters is both a rebuke of Unferth and a foreshadowing of his own underwater battle with Grendel's mother. Beowulf's resulting fame will strike fear into the hearts of those that might invade Geatland and will protect the country for many years. Because Beowulf is good— that is, because he is strong, brave, and articulate—he is worthy of glory and remembrance.
The concepts of good and evil in Beowulf are very important. Identified as a major theme within the text, Beowulf and his epic battles depict the historical war between those who war for God (Beowulf) being good and those who oppose God (Grendel, his mother, and the dragon) as evil.
In the epic, the protagonist fights a God-despiser. In Beowulf, Grendel and his mother represent God-despisers. Since being exiled for being a kin of Cain, Grendel is jealous of those who are able to revel in the light of God. This sets him up to be a natural antagonist of Beowulf (a warrior for God). In both his fight with Grendel and his mother, Beowulf recognizes that God is ultimately in charge. He, Beowulf, does not fear death because if his death is God's will he will openly welcome his own death.
In the end, the battles are all about good (Beowulf) and evil (the monsters) and Beowulf's triumph symbolizing the victory of good over evil. Essentially, Beowulf's battles with both Grendel and Grendel's mother present the concept of good and evil.