Miss Emily was desperate to hold on to something in her life. Her father, the focus of much of her life, was gone, the town was modernizing, and her family wanted little to do with her aside from making decisions about the morality of her choices.
Homer breathed life into her otherwise dull and dreary existence. Not only was he exciting, but her relationship with him was scandalous. When he wanted to leave, because he was not interested in marriage, Miss Emily could not take another loss and killed him.
She did not kill him out of malice, however. She killed him to keep him with her. This is made clear by the presence of the "long iron-grey hair" on the pillow next to Homer's body. That along with "the indentation of a head," on the second pillow, indicates that Miss Emily spent time lying next to Homer's body in an attempt to ease her loneliness.
The "long iron-grey hair" belongs to Emily. She had killed Homer many years before, most likely with the poison she had purchased. There had been talk that Homer was leaving Emily and that he wasn't the marrying kind of man, so the only way Emily could keep him was to kill him. All of these years, she had been sleeping by Homer's corpse.
This gruesome end of the story demonstrates how desperate Emily was to have someone in her life. She was lonely, and she needed someone to love her and someone for her to love. When her father died, she wouldn't allow his body to be removed for three days. His overprotection of her left her without anyone after he died. She replaced that love of her father with Homer.
None of the other answers address this question. What does the hair symbolize? That it belongs to Emily is obvious because of the earlier reference to her hair, "Up until the day of her death at 74, it was still that vigorous iron-gray."
Anyone who has studied Faulkner at all knows that his obsession was the dying/decaying South. That's what this story is all about. The necrophilia is just candy for what Flannery O'Connor would describe as "the average reader." Yeah, there's the stuff about her daddy, but that's not the main point.
Emily, and her Dad, represent the old south. They really are allegorical characters. There's very little character development; she simply is the last remnant of the old south, the confederate gray. She is the old generation.
Yes, it is ironic that she, of all people ends up with a Yankee. But from her generation's point of view, the yankees really did come down and screw the south (to put it gently). The baser capitalisitic and opportunistic values of the north pollute the bed of the south for generations to come. This may be why Emily's relationship with Homer is so unnatural.
The final image of the book is a bed with a rotting corpse of a yankee--Homer--and a single iron-gray hair. The symbolism could not be more obvious.
In response to your question, Faulkner never really gives the reader reference to the fact that Miss. Emily slept next to Homer's dead body. It is we the reader who conclude this, because of the long iron grey hair that is found next to Homer's now decayed body. Take another look at the text closely and you will discover that Emily died in an entirely seperat room from her dearly departed, ie, her body was discovered in the "oak wood" bed down stairs. In light of them encountering this oddness, why didn't she die in the arms of her lover, which had a smile on his face, with his arms still in the position of embrasing someone, (Emily). When the towns men finaly entered her doomed bridal chamber, there was already an emprint of a head in the pillow, the long iron grey hair was not hers. It is possibly belonged to that of another dearly departed female relative, whom she was closely connected to. Remember, as part of this gothic tale, Emily suffers from necrophilia.