dislike instinctively; have an antipathy to
Used to express an instinctive, often unexplainable dislike for someone. The subject is usually the person disliked, marked with が.
I just can't bring myself to like him.
I have an instinctive dislike for that boss, so I try to avoid dealing with him as much as possible.
嫌い is a plain, general word for disliking someone or something, whereas 虫が好かない specifically implies a gut-level aversion with no clear reason.
気が合う describes an instinctive sense of getting along well with someone, the opposite feeling to 虫が好かない.
虫の居所が悪い means someone is in a bad mood, while 虫が好かない means finding a particular person instinctively unlikeable; both use 虫 but describe different things.
The expression literally means 'the bug does not like,' where 虫 (bug) refers to a person's inner feelings or temperament. The exact origin is uncertain, but it reflects the traditional idea that one's gut feeling or 'inner bug' determines likes and dislikes.