The section on the Grangerford-Shepherdson feud plays an important role in Huck's maturing. What struck you as being the prime reason Twain included this scene.
Huckleberry's exposure to the Grangefords in Mark Twain's Huckleberry Finn conveys a situation that is no different than a transition from ignorance to knowledge, from innocence to maturity, and from fantasy to reality. It is safe to argue that the Grangeford experience is the rite of passage that moves Huckleberry's character from a happy-go-lucky and oblivious child to an analytical and more watchful young adult.
The Grangefords were Huck's ideal of the grand and the great. He found politeness and class in their exaggerated mannerisms; He saw grandiosity and elegance in their over-stuffed and tacky home, and he saw a strong family unit in what was really a dysfunctional, and oddly- behaved, lot.
Yet, as he notices the bloody feud between the Grangefords and the Sheperdsons, he begins to question exactly what could create hatred so extreme that it can live within the same two families from generation to generation. To top it all, Huck witnesses how the two families bring their weapons even to church, and keep a watchful eye over each other while they are also "worshipping God". The tension must have been thick enough for Huck to sense, even as innocent as he is, that what he is seeing is a deeply disturbed family, and not the great clan he had imagined them to be.
This is what makes Huck analyze, for the first time, that looks are deceiving, and that life cannot be taken at face value. Perhaps this is why he, after finding Jim and re-embarking on his raft with him, Huck says the words:
Other places do seem so cramped up and smothery, but a raft don’t. You feel mighty free and easy and comfortable on a raft.
What this means is simple: Huck comes to the realization that home is not some place created by others to provide for you, but that your home is what you make of it; Huck's home is his raft, while Jim is the closest thing he has to family.