We already mentioned this issue in baba kama 94 - there is a machlokes rambam and tur whether one is obligated to honor a father who is a rasha. The Rambam holds that there is a mitzva of kibud av, but the Tur uses our gemara to disagree. See here for the discussion about it:
Perhaps we can offer another rationale to justify the position of the Rambam so that he is not contradicted by the gemara. The gemara isn't claiming that only for an עושה מעשה עמך is there a mitzvah of kibud av, to the exclusion of a rasha. The gemara isn't dealing in general with the mitzvah of kibud av, rather it is dealing with whether the children are obligated to return an object that was taken as ribbis or stolen, that they inherited from their father. Perhaps the gemara is saying that although they are commanded in the mitzvah of kibud av, they wouldn't be required to return the object. Why? Because when the father didn't do teshuva in his lifetime and didn't return the object, it is as if the father was mochel on this aspect of his kavod. However, if the father did teshuva and wanted to return it but didn't get a chance, then the sons would be obligated to return this item for kavod of their father as they would be chayev in all kavod of their father.
Another distinction made by the kesef mishna is that so long as the father is alive, even if he is a rasha he may do teshuva and therefore there is a mitzvah of kavod to honor him. However, when he dies a rasha there is no longer a mitzvah to honor him since he definitely will not do teshuva.