I think the idea and principles that Gandhi stood for are nevertheless important just as the ideas and principles the Founding Fathers of the US had in mind when framing the constitution are considered important. The details of Gandhi's life are slightly less important. Also, people fail to realize the context behind a lot of Gandhi's misgivings. It was a different era (which is no excuse) but even Abraham Lincoln wasn't of the opinion that blacks are equals and the Founding Fathers owned slaves themselves.
The lesson is to take their stories with a pinch of salt, but nevertheless feel motivated and inspired by the goals and ideals these famous people represented, not the minutiae of their actual lives.