Not all cats like being around people. In many cases, cats can are fearful of strangers, new environments, or just changes to their routine. When this occurs, a cat may suffer from anxiety.
Some symptoms of anxiety include defecating outside the litter box, howling, hiding, or vomiting. To treat cat anxiety, try making the environment more interesting with additional cat toys, climbing posts, and anything else that will cost you money that your cat will likely ignore anyway.