There never was an Officer Andy Landers, but, as conceived by Spike Lee, he’s crudely functional, a villain with a destiny as awful as it is seductive. In “BlacKkKlansman,” Lee’s summer hit based loosely on the true story of Ron Stallworth, a black police officer who infiltrated the Ku Klux Klan in Colorado in the 1970s, Landers is the cretin within, an unreformed racist among Stallworth’s own ranks.

In the movie’s final act, the cretin gets his comeuppance. Stallworth and his girlfriend, Patrice Dumas, a black power activist who had been groped by Landers, secretly record him in a bar boasting of his misdeeds. Moments later he’s carried away in handcuffs while Stallworth, Dumas and two right-minded white colleagues (on hand as corroborating witnesses) toast to justice well served.

The scene is meant as a chaser of racial harmony after what is essentially two hours of high-proof bigotry and recrimination. As Hollywood endings go, it’s standard issue. What’s notable is the fact that it’s Lee behind the camera — a man whose signature early films, including his landmark, “Do the Right Thing,” so often eschewed such tidy suturing of America’s most persistent wound.

But that was then. Among several films that have reckoned with the story of racial justice in America in 2018, “BlacKkKlansman” is far from alone in extracting a hopeful resolution from the jaws of despair.