This is an impossible question to answer definitively without a supporting quote from the author. No such quote appears to exist: I haven't been able to source anything in which Hardy discusses his religious or racial views. However, we can place this in the wider context of the time
Hardy was born in 1840, at which point acceptance of Jews in British society had turned a corner. Catholics had been emancipated by a series of laws passed in 1829, and Jews hoped that this set a precedent for religious freedom across the board. They were not disappointed: Parliament engaged with the issue and by 1837, matters had advanced to the point where Queen Victoria knighted a Jew, Moses Haim Montefiore. By 1858 Jewish emancipation had been enshrined in law, there was a Jew in the House of Commons, a Jewish baronet, and a Jew sitting as Mayor of London.
The change in attitudes was reflected in contemporary literature. Strong arguments can be made that the work of both George Eliot and William Makepeace Thackeray contain purposeful themes critiquing discrimination against Jews.This does not, of course, mean that anti-semitism vanished over these years. H. Rider Haggard's 1885 novel She contains a chapter in which two characters have a virulently anti-semitic discussion. However, there can be little doubt that it did diminish.
Hardy, therefore, would have been raised at a time when it was not the prevailing cultural attitude. He lived in cosmopolitan London as a student in the 1860's, exactly the time and place in which this chain of events was reaching its zenith. He was also well known for his views on social reform and liberalism. It, therefore, seems unlikely that Hardy would have held much in the way of subconscious antisemitic bias.
What, then, is the reason for this passage? In the novel - which is set in a period roughly contemporary or slightly before its 1895 publication date - Jude is presented as someone who has doubts about the prevailing spirituality of the time. He seems fascinated by an ancient well in the village, which he feels is
"the only relic of the local history that remained absolutely unchanged"
While the new church is seen as the destructive force which bulldozed the remainder of that history, "obliterating" the graves of local families and retaining no record of the original chapel.
Jude is thus someone who is likely to have doubts about the efficacy of prayer as a means of getting things done, turning to it only because it is a socially accepted norm. By offering the suggestion that the only reason for the failure of prayer is due to a man's trousers (breeches) being made by a "wicked Jew", Hardy is ridiculing the notion that prayer works at all. The inclusion of the word "wicked" is as a shorthand to highlight both the non-Christian nature of the Jewish tailor and the idiocy of the suggestion that trousers are sufficient to cause a prayer to fail.
- The Jewish Encyclopedia: Volume 5
- Thomas Hardy: The "dream-country" of His Fiction, Anne Alexander