Why shouldn’t it be
Could you please explain to me why に is used in this expression? Is で incorrect here or is there a difference in nuance?
First off, let us check a corpus to see if there is actually a difference in distribution. Here are some results from BCCWJ (searching with the stem 「濡れ」 to capture multiple different inflections):
に で 比
雨に濡れ １３８ ／ 雨で濡れ １２ ＝ １１．５
水に濡れ ４８ ／ 水で濡れ ７ ＝ ６．９
涙に濡れ ２１ ／ 涙で濡れ ２０ ＝ １．１
汗に濡れ ２２ ／ 汗で濡れ ２６ ＝ ０．８
There definitely seems to be a difference in distribution: some arguments (雨、水) highly prefer に, while other arguments are more indifferent between に and で (涙, 汗).
I think the fundamental difference that に is more about simply describing what something is wet with, suggesting a natural, spontaneous, or passive process, while で suggests an active cause-effect process. (Similar to these two answers: 1, 2 on 揺れる with に or で.)
That's not to say you can't use で with 雨; I think the following is just fine, for example:
In this case you are emphasizing that you will "get wet because of the rain", not just that you will get wet in the rain, so the cause-effect nuance of で fits. Of course 雨に works fine here too.
Despite the rather tilted BCCWJ hit counts, I think in general both で and に are acceptable, but nuance-wise one sometimes fits better than the other.