Touching the private part without a barrier invalidates wudoo’ according to many scholars among the Sahaabah and those who came after them of the Taabi‘een and the imams, including Maalik, al-Shaafa‘i and Ahmad. They quoted as evidence for that several hadeeths, including the words of the Prophet (blessings and peace of Allah be upon him): “Whoever touches his private part, let him do wudoo’.” Narrated by Abu Dawood (181) and classed as saheeh by al-Albaani in Saheeh Abi Dawood.
Others were of the view that touching the private part does not invalidate wudoo’, as is the view of Abu Haneefah.
Some of the scholars differentiated between touching the private part with desire and without desire. Wudoo’ is invalidated if it is touched with desire, and it is not invalidated if it is without desire.
This is a very strong opinion and was regarded as such by Shaykh Ibn ‘Uthaymeen in al-Sharh al-Mumti‘. He stated clearly that he regarded it as more correct in his commentary on Buloogh al-Maraam.
To sum up: if a person touches his private part, it is mustahabb for him to do wudoo’ in all cases, whether he touched it with desire or not. If he touched it with desire, then the view that it is obligatory (for him to do wudoo’) is very strong.
End quote from al-Sharh al-Mumti‘, 1/234
With regard to touching it from behind a barrier, that does not invalidate wudoo’.
Al-Mardaawi said in al-Insaaf (1/202): The apparent meaning of his words, “touching the private part with his hand”, is that the touching occurs without a barrier, and this is the correct view.
Ibn ‘Uthaymeen said in al-Sharh al-Mumti‘ (1/228): Because if there is a barrier, it is not regarded as touching.
And Allah knows best.