I have known people to behave in a way they despise, and they don't know why.
Modern theories of emotion suggest that like many aspects of self-knowledge, emotion is "inferred" rather than "introspected".
This is exemplified by a classic experiment in which men were surveyed by an attractive female interviewer while on a bridge. Some of the men were on a "fear-arousing" suspension bridge, while other men were on a "non-fear-arousing" solid bridge. Men surveyed on the suspension bridge were more likely to include sexual content in their answers, and more likely to call the interviewer later. Presumably the men on the suspension bridge were more aroused than the ones on the solid bridge, and misattributed their arousal to the attractiveness of the interviewer.
Similar research supports the idea that physiological inputs (eg, the effects of hormones in our system) are combined with a process of inference to produce emotion.
Imagine having a low level of serotonin in your brain. This may cause a negative effect on your mood - sadness. Now you want to know why. So you search for possible reasons: Maybe a conversation you had recently didn't go well, maybe your bank account is low on funds, maybe you notice that you haven't spent time with friends lately... Successful attribution typically requires a plausible cause-and-effect relationship - that is, the most likely explanation is probably the correct one.
Put another way, people in general sense physiological states (such as sadness) without knowing why. They then (unconsciously) "guess" why through inference. Sometimes they get it right, and sometimes they get it wrong. If you've ever had a girlfriend on her period blame her feelings on the way you treat her, then you know what I mean. So the reality is that people who feel sad and don't know why, are ... accurate. The only difference between feeling sad and knowing why, and feeling sad and not knowing why, is successful attribution - coming up with a plausible guess.
Emotional experience may be modeled in a variety of ways. I favor the circumplex model for describing the structure of subjective emotional experiences in any given moment:
However, positive and negative affect are not polar opposites as they occur over time; the relationship between frequencies of positive and negative emotions is only weakly to moderately negative, as befits the two-factor structure of the Positive and Negative Affect Schedule (PANAS; Watson, Clark, & Tellegen, 1988), a common measure of retrospective affective experience over brief periods of time.
One may feel sadness, or self-loathing, or any emotion in a given moment without knowing why immediately, if ever. Self-awareness and emotional insight are separate from the capacity for emotion. Some people barely understand any of their emotions, let alone their sources, though I think most of us probably understand most of our emotions.
Given the extremely limited information in this question (full disclosure: I flagged it as too broad...you'll see why by the time I'm done with this gargantuan answer), I've already offered two very general possibilities:
If a person tends to experience a lot of negative emotion over a wide range of circumstances, it might not be so unusual to be confused about why it won't go away. Negative emotion tends to wear away at a person over time, especially when it's intense, unremitting, and therefore often self-reinforcing and somewhat irrational. In this case, one might also infer some information about that person's personality. Then again, this kind of consistency in a person's emotions and behavior can be fairly hard to observe, especially over a short time, especially without actually knowing that person well or communicating with her. Therefore the main message here is to withhold judgment unless you have really known someone across multiple contexts and a decent length of time, and talked to her about the relevant behavior. This isn't to say that our intuitive judgments are necessarily wrong; we're actually pretty good intuitive judges of each others' personalities. My point is that there is no certainty to be had on these matters, maybe not even over the course of a year of open interaction and observation in a professional psychotherapist's (or psychometrician's!) office. How could there be, when none of us truly understand our every single emotion, and when even a sense of certainty can prove false? Epistemological issues like these are somewhat inescapable in matters of subjective phenomenology like emotion (of any kind).
Further cautions are in order in light of @caseyr547's answer. The answer is not invalid, but it is rather focused on abnormal psychological issues related to the emotions described vaguely in the OP: sadness, guilt, and self-hatred. Major depressive disorder and bipolar disorder apply to a fairly extreme subset of the potential interpretations of your very broad question. If you take a look at the diagnosis section of the major depression Wiki, you'll see it's not a simple matter to qualify. For instance, "A major depressive episode is characterized by the presence of a severely depressed mood that persists for at least two weeks." [Emphasis added.] Another glance at the epidemiology section will tell you that major depression is pretty rare; maybe rarer than you'd expect, especially after a brief skim of that list of criteria that includes, "Fatigue or loss of energy," and, "Insomnia or sleeping too much."
Moreover, depression may be better understood more commonly as a symptom than as a disorder unto itself. Clinical and subclinical depression have a wide variety of causes, some of which would make most of us depressed (without really modifying our personalities in a long-term way). Even within the domain of abnormal psychology, depression may result from a much broader and frequently comorbid spectrum of psychiatric syndromes than merely bipolar disorder. The spectrum spans much of the first and second axes of the DSM-IV, and spans much of the third and fourth too if we loosen our definition of psychiatric syndromes enough. It's therefore important to recognize (and irresponsible to not mention) that depression, especially subclinical depression (e.g., lasting less than two weeks) can occur for a very wide range of reasons, most of which do not require (or justify) medication. Even those that may justify medication do not necessarily require it, nor should medication be assumed a sufficient treatment unto itself for any disorder. Most people with psychiatric disorders can benefit from counseling (with or without pharmacotherapy), as can most everyone else. No stigmas, labels, or minimal criteria should be attached (implicitly or otherwise) to the prospect of seeing a counselor for help with understanding or managing negative emotions of any kind. Some negative emotion is normal; no one need deal with it alone.
Since some negative emotion is normal, negative emotionality also varies normally, and "normal" allows quite a lot of room for noticeable individual differences. Negative emotionality (as subjectively reported using the PANAS, and other similar measures) follows a roughly normal distribution ("bell curve"), meaning that over two thirds of the population varies across a range of two standard deviations, which is more than enough to include perceptible differences as judged by others. If, for example, you would happen to score one standard deviation (SD) below the population average on a measure of negative emotionality, and you happen to know the other person reasonably well (e.g., you've been friends or even classmates for a year or two), and that other person happens to score one SD above the population average on negative emotionality, I'd be willing to bet that with a difference of two SDs between you, you're much more likely to be aware (than not aware) that the other person experiences more negative emotionality than you. Nevertheless, in this example, you would both still be essentially normal individuals (at least, insofar as I've described you two here at all), and nothing would be "wrong" with either of you necessarily.
This is not to say that, in this example, you would both be equally likely to be psychologically healthy, let alone equally healthy. Psychological well-being, negative emotionality, and neuroticism are all roughly, normally distributed in the general population, and all three exhibit moderately strong bivariate correlations. That is, in this example, the person with more negative emotionality than you (+1 SD, vs. your -1 SD, a 2 SD difference) would score about .9 SD lower on psychological well-being (on average; that's a rough point estimate of |r| = .45 with a big margin of error, as far as I know), and about .9 SD higher on neuroticism (same disclaimers apply). Again, some neuroticism is normal, everybody's a little bit neurotic, myself included, and a little bit of it is probably good (that is, it's probably healthier to be average than extremely low). That's not to say more neuroticism isn't harmlessly different from less neuroticism, all else being not equal in proportion. As with negative emotionality, neuroticism relates to a lot of increased health risks, psychological and otherwise (see for instance Roberts, Kuncel, Shiner, Caspi, & Goldberg, 2007). It's in this sense that caseyr547's answer isn't wrong: there is a greater risk of those disorders at higher levels of negative emotionality and neuroticism, if that is in fact what we're talking about. In this extended discussion of personality, do not forget that your question does not necessarily describe a usefully informative observation of personality.
Anyway, what's to be made of all this information? What should we do with it? I'm afraid I'm not making the slightly more negative-or-neurotic-than-average among us feel any better (though they are probably still well within the "normal" range of individual variation)...and I'm afraid I might be talking to myself by asking these rhetorical questions, so I'll address both sides of the OP, but try to keep it brief.
Roberts, B. W., Kuncel, N. R., Shiner, R., Caspi, A., & Goldberg, L. R. (2007). The power of personality: The comparative validity of personality traits, socioeconomic status, and cognitive ability for predicting important life outcomes. Perspectives on Psychological Science, 2(4), 313–345.
Watson, D., Clark, L. A., & Tellegen, A. (1988). Development and validation of brief measures of positive and negative affect: the PANAS scales. Journal of Personality and Social Psychology, 54(6), 1063–1070. Available online, URL: http://www.cnbc.pt/jpmatos/28.Watson.pdf. Accessed January 9, 2014.
This is only a guess at why one might feel sad and act irrational there are many other things which could cause such behaviour. (Like for instance something could cause you to be sad and depressed but you forget the thing that hurt you. Leading to depression caused by anger. )
Clinical depression otherwise known as Major depressive disorder afflicts many people world wide. Often it can be correctable with an anti-depressant. DSM IV and DSM 5 have these listed as diagnostic criteria:
It is easy to confuse MDD for Bipolar because bipolar has a depressive, hypomania (elated) and mania (angry, insomnia and hypersexuality) features and in DSM 5 Bipolar is a superset of MDD. Bipolar disorders are more difficult to correct and depending on the doctors diagnosis they may prescribe anything from lithium a mood stabilizer to major sedatives.
While the first post went on to explicate a model of emotional experience, it did not tackle the actual question of why a person does not know why it feels that way.
First of all, figuring out the reason why certain things are a certain way involves inferential processing and reasoning. Explaining one's behavior and emotional states to oneself fuels neortical processes which might not have the capacity to fully resolve the question. From my point of view there are two possible heuristcs for this. Firstly, there might be a strong connection between the emotional processes and the thinking capabilities (in terms of causal reasoning), in which emotional default states corrupt reasoning. The habituation to and the reinforcement of behavioral patterns associated with emotional states may be so strong that problem solving is hardly possible (or the knowledge about behaviors might be seen as "wrong" only in retrospect but not when the critical situation is actually happening). It is established that the limbic system, a driving force of motivation and behavior, can effectively overrun neocortical activity (especially frontal cortical areas), rendering reasoning effectively incapable of problem solving under certain circumstances (known as "being overrun" by emotional states). This overrunning can persist chronically due to the strength of emotional activity and lead to behaviors and emotional states which might appear to be incontrolable by the subject - leading to repetition of behaviors which do not lead to an a priori desired state.
Secondly, the exact opposite can also hold true, namely that emotional states may be too disconnected from reasoning. In this case, neocortical activity just has not the capacity to resolve the multidimensional problem space which is embodied in the limbic system activity. Limbic activity is mostly reward-driven, so that this part of the nervous system actively seeks for consummatory behaviors which are tightly connected to homeostasis (sexuality, food, drinking, relaxation ...). Since the neocortical activity relies on input to make conscious conclusions about certain states (internal or external), a weak connection between the midbrain and the endbrain might lead to a lack of understanding or misunderstanding of own behaviors - by still perpetuating the behaviors and emotional states which have certain motivations, but stay incapable of being reflected upon.
In general, "feeling sad" probably has many reasons, so a good solution to the problem is to talk to other individuals in order to receive new input and by this to outsource problem solving to helping others, so that own critical thinking becomes less corrupted by the system it resides in ...