There are quite a few reasons to not invest in a company's stock. The biggest reason, of course, is that the company is not a good financial investment. Perhaps the earnings are not good or the growth is lackluster. Perhaps you are already over-invested in the sector and want to make sure that your portfolio is balanced. Spending a few minutes on this site will show many examples of companies to avoid for one of many reasons.
Another reason to not buy a stock is that you personally do not like the company. Perhaps it engages in selling products that you don't think should be sold (alcohol and cigarettes comes to mind). Perhaps it sells fast food and you think Americans eat too much fast food. Perhaps it is a medical insurance company and you think medical insurance should not be a profit making venture. Perhaps it is a military contractor and you don't want to be part of the war machine. Perhaps you think the CEO is a goof ball and cannot see how he will not destroy the company even if it is financially strong today.
Whatever your reason for not investing in a company, that is your right. I will never suggest that someone violate their principles in search of profit. Our standards are intensely personal and should never be violated. Unfortunately, one of the most famous modern investors that I really admire, Jim Cramer of Mad Money, doesn't agree with me on this point. That is okay - we are all entitled to our opinion.
However, the opposite corollary of this is simply not true! While you should never buy a company's stock if you don't like the stock, you definitely should never buy a company's stock just because you like the company or its products. Peter Lynch (another famous investor) coined the term "buy what you know." While this is a fine place to start, you should never own a company's stock just because you buy the company's products! You need to make sure that they are an extremely well run organization and do your due diligence on their financial condition.