There has been some research that has shown that OCD does tend to run in families. Some researches believe it might be genetic. There are several theories about why people get OCD. Here is one article that talks about some of the ideas. Here are two more articles about it.