The gemara in Yoma (22b) tells us that when Shaul received the command to wage war and destroy Amalek, he made a kal v'chomer: If for the death of one person the Torah commands that an eglah arufa be brought, kal vl'chomer we would need kaparah for the death of thousands, men women and children and even animals too. And so Shaul failed to properly carry out the dvar Hashem.
Iyun Ya'akon on the Ein Ya'akov asks: Why did Shaul draw a kal v'chomer from the special parsha of eglah arufa which deals with a situation where we don't know who the murderer is? In the case of war with Amalek, we know full well who would be doing the killing. The gemara should have made its kal v'chomer from a regular murder case: If for the murder of a single person an individual is chayav misa, kal v'chomer the seriousness of killing off an entire nation.
I think we can answer the Iyun Ya'akov's question by putting two other gemaras together. The gemara in Sota asks: Why is it that the ceremony of eglah arufa is performed by the elders of the city? Why are the elders asking for forgiveness -- do we suspect them of having killed the corpse found in their city? The gemara answers that the elders must ask forgiveness for not welcoming this stranger into their town. It's only because the victim had so place to go, no one welcomed him for a meal, no one offered a room for the night to a stranger, that this poor soul was left to wander the streets and ended up falling prey to some bandit or outlaw.
Amalek was the offspring of Timna and Eliphaz, the son of Eisav (Braishis 36:12). Chazal (Sanhedrin 99) tell us that Timna was a princess who came to Avraham, Yitzchak, and Ya'akov and wanted to convert and join their family. They, however, refused to accept her. Rather than return home, Timna became Eliphaz's concubine, as it was better in her eyes to be a servant to a branch of the family of the Avos than to be a princess in her own home. As a result of Timna being sent away (and obviously the Avos must have had some reason for their actions that we are not privy to) and not being welcomed into Klal Yisrael, Amalek came into the world.
Putting the two together, perhaps the gemara davka focusses on the parsha of eglah arufah and not a regular parsha that deals with murder because the parsha of eglah arufa teaches us the importance of opening our communities to guests, to strangers, and to anyone who has no other place in the world. Given the Torah's emphasis on not closing the door to strangers, kal v'chomer, reasoned Shaul, that perhaps the command from Hashem to obliterare Amalek should be understood in a different light, as was it not our own community's cold reception of Timna and our slamming the door on her that brought Amalek into the world to begin with?