It compares because it's a civil rights movement for a group of people who are being denied equal rights by the government. So the similarities are that it's a struggle for EQUALITY (that's the key word when comparing these issues) and the difference is that it's about sexual-orientation, not race.
Those who are opposed to equal rights for LGBT people, usually religious bigots who think the bible has any meaning on U.S. law (see above answers), often suggest that it's wrong for LGBT people to equate the LGBT rights movement to the black civil rights movement. What's being compared is the movement for equality, just like how people who were associated with the black civil rights movement were pushing for equality, just like how women's rights activists pushed for equality, just like how Native Americans pushed for equality, or at least as much as they could after having their land stolen from them.
So from a constitutional and legal stand point, it compares because it's about equality. The constitution is supposed to allow equality for all citizens, and currently, a group of people are being denied equality.
Those who oppose LGBT rights usually suggest that LGBT people don't have a right to lobby for gay rights because such rights shouldn't exist. That's what people opposed to black rights said in the past.
"They don't need extra rights, the constitution has nothing to do with race! Blacks should know their place!" ... "women don't need extra rights, the constitution has nothing to do with gender! Women belong in the kitchen!" ... and now: "gays don't need extra rights, the constitution has nothing to do with sexuality!" -- what those people don't understand is the concept of equality.
Here's some more info on the struggle for equality for LGBT people: http://www.hrc.org/issues/5517.htm