The first thing that has to be said with regard to this question is that the manner in which God Judges and/or Evaluates our actions is difficult to determine with any certainty. We can cite Rabbinic sources that deal with such questions, always with the caveat that God’s Actions are by definition ultimately inscrutable from the point of view of finite man. Perhaps the most pithy statement to this effect is Exodus 33:18-9, where the verb “to see” is interpreted to mean “to understand.” In a broader literary context, the book of Job is entirely devoted to this question, with the final section, beginning with chapt. 38, built upon the premise that man cannot comprehend God and the reasons for His Actions, since he does not possess God’s Perspective or Vantage Point.
With regard to the specific question of Divine Judgment regarding human thoughts and fantasies, the Talmudic principle, “Ones Rachmana Patrai” (one who is under duress, is not held accountable by the Divine)—e.g., Bava Kamma 28b, interpreting Deuteronomy 22:26—could be applied to thoughts and fantasies that pop into one’s mind or dreams that are uninvited and undesired. Not only is it logical to believe that one is not Judged for such ruminations, the popular Shabbat Hymn, “Mah Yedidut Menuchatech” (“How Beloved is Your Rest”) contains the line, “Chafatzecha Asurim VeGam LaCheshov Cheshbonot; Hirhurim Mutarim…” (Your business interests are forbidden, considering money matters; But thinking is permitted...) In other words, while even speaking about issues such as financial concerns, that run afoul of the letter and spirit of Shabbat is not permitted, one’s thoughts are not so easily controlled and regulated, and it would be unfair to hold the thinker accountable in such a circumstance.
However, not all thoughts are spontaneously generated and therefore free of human involvement. Deliberately exposing oneself to certain sights, language, music, literature, etc. can directly precipitate improper thoughts and fantasies, leading to religious remonstrations against such behavior. This line of reasoning underlies the rules of personal modesty, the warnings against the use of obscene language and exposure to inappropriate cultural experiences, the abominations of pornography, and the like.
A final area of personal thought that is subject to Divine Scrutiny concerns traditional belief. Maimonides in Mishneh Tora, The Laws of Idolatry 2:4, based upon Deuteronomy 11:16, states that mere heretical thoughts and speculations with respect to matters such as idolatry, the nature of God and the Divine origin of the Tora, even if one does not act upon such thoughts, already are defined as major transgressions. Since the means of fulfilling these particular Commandments is via interior belief rather than any specific course of action, the converses of these beliefs constitute the violations of the Commandments in question.
In summary, the vast majority of thoughts and fantasies, assuming that they have not been premeditatedly initiated on the part of the individual are deemed non-culpable; yet there are some thoughts that Jewish law demands one must at least attempt to actively resist, since they lie at the heart of the religious enterprise.
In an infamous interview with Playboy magazine in November 1976, former American president and Baptist pastor Jimmy Carter confessed that he had “lusted in his heart” and “committed adultery in his heart many times.” To many Christians this seemed to be a courageous act of faith. But it made many Jews uncomfortable. The idea that what a person might think about or fantasize would be sinful seems foreign to Jews who have been taught that actions alone matter. In a way, that is true. Eighteenth century Moses Mendelssohn wrote that what distinguishes Judaism from Christianity is the fact that the former is a religion of deed while the latter is a religion of creed. Supporting this view are the relatively few commandments in the Torah that circumscribe thoughts. Jews are forbidden to covet and to hate a fellow Jew in their hearts. But holding a Jew responsible for the violation of these mitzvot is difficult, if not impossible, unless the thought leads go some action. There is no “thought police” that can arrest, charge, and punish those who harbor illicit thoughts. Yet that does not mean that God does not punish Jews for having them. And that question – your question - is a different and important one. That the Torah still lists covetousness (jealousy) and hatred as legally proscribed means they are punishable offenses. And that implies that God must be doing the judging…and the punishing. A refrain in the High Holiday liturgy is that God inspects the innermost thoughts of us all, and presumably holding us accountable for improper thoughts. And Rabbi Joseph Karo (Shulhan Arukh, Orah Hayyim 240:9) rules that it is wrong to fantasize about other women while engaged in sexual intercourse with one’s wife. But exactly what divine penalties ensue should Jews have improper thoughts remains unstated and unclear.
If you mean, do Jews believe that we are judged by G-d for thoughts, fantasies, imagination, desires, urges, or wishes upon which we do not act (and which we do not seek), the answer is a simple and emphatic NO.
If a married woman sees a very attractive man and has a fantasy about kissing him, for example, but does nothing to pursue that urge, there is no foul, no wrong. Similarly, if a man has a strong attraction to precious gems, and sees and covets a beautiful necklace, then imagines himself stealing and possessing it, so long as he does nothing, there is still no foul and no wrong (putting aside any discussion about the injunction against coveting). The issue is not what one thinks or imagines or fatasizes, but what one does.
This is a significant difference between Judaism and much of Christianity, to my understanding. In Christian thought there seems to be an approach that one is not permitted to have such thoughts or desires, and that to do so is sinful. I recall some time back, when he was a Presidential candidate, Jimmy Carter admitted woefully to the 'sin' of lust in his heart - something that made little sense from a Jewish perspective.
Judaism has the twin concepts of the Yetzer HaRa (the inclination towards "evil") and the Yetzer HaTov (the inclination towards "good"). There is a teaching in Judaism that both are required.
The Yetzer HaTov is what leads us to be compassionate, caring, concerned with others, kind, and to seek fairness and justice. The Yetzer HaRa is the source of desires, of seeking to acquire and own, sexual urges, urges towards power, success, and wealth, and so on.
These desires, urges, or inclinations are not evil in and of themselves; it is what we do and how we act in response that determines what their effect will be. If a person did not have a Yetzer HaRa, they would never be motivated to accomplish anything, to succeed at anything, to build anything, to improve anything, to have a family, or to buy a home. It is, after all, self-interest of some sort, the desire to fulfill these inclinations and urges, that drives people to find new and better ways to do things, to develop products that others will want, to seek leadership positions, and to try to better themselves and their situation.
If we lived in a world of complete 'saints' - people who had only the Yetzer HaTov, it would be a very primitive and limited world indeed. People might all be good, but there would be little that would tempt them to do anything at all, and no reason that they would seek to change or better things or themselves.We might all still be living in caves, using clubs as our only tool.
At the same time, if one did not have a Yetzer HaTov, there would be no bounds or limits on what was acceptable to do to 'win', and that person would be completely amoral (having no sense of morality and no concern with anyone else, only with satisfying their own desires).
Our requirement and task as human beings is to find the proper balance between these two urges or inclinations so we can act in a godly fashion, yet still be a productive member of our society and community. The ability to choose how to respond to our urges and inclinations and desires is what we often call 'free will'.
In short, you need both a Yetzer HaRa and a Yetzer HaTov to function. Since these are components of a normal human being, as G-d created us, there can be nothing wrong with having them, or with the results of having either one - including fantasies and thoughts, and we will not be judged for what we feel inclined or urged towards, only what we actually act upon and do.