The central mystery of In the Heat of the Night is filled with red herrings, designed to expose the prejudices of the local police. The victim, wealthy industrialist Philip Colbert, is found murdered in the street. Chief Gillespie initially suspects Virgil Tibbs simply for being Black and having money. After Tibbs is cleared, Gillespie hastily arrests Harvey Oberst, a local thief caught with Colbert's wallet. Tibbs clears Oberst by proving the killer was right-handed, whereas Oberst is left-handed.
Later, Gillespie arrests his own deputy, Sam Wood, because Sam had paid off a large mortgage in cash, and a young local woman, Delores Purdy, falsely accuses Sam of getting her pregnant. Tibbs, remaining objective, deduces that Sam is innocent and that Delores is actually covering for her real lover to get money for an illegal abortion.
The Final Twist: Tibbs tracks the abortion arrangement to a local underground clinic. Delores arrives, but is followed by the true killer: Ralph Henshaw, the unassuming, racist counterman at the local diner. Ralph confesses that he was Delores's secret lover and needed money to pay for her abortion. He hitchhiked with Colbert, attempted to rob him for the abortion funds, and ended up bludgeoning him to death. The brilliance of the ending lies in the fact that the murder had absolutely nothing to do with race, integration, or Colbert's new factory—it was a desperate crime of passion and greed committed by a minor character, subverting the audience's expectation of a grand, racially motivated conspiracy.