Some news outlets are suggesting that it was hot and their hands were sweaty - the weather wasn't conducive to hand holding. Others say that Melania was trying to avoid an incident in a country where religious sensitivities disapprove of public intimacy.
It is true that Orthodox Jews don't touch in public - they believe that intimacy is special, private and reserved for the bedroom. This standard of behavior however, is not expected of everyone including secular Israeli Jews. Add to that, the couples (Netanyahu and Trump) all exchanged hugs and kisses on the tarmac so clearly the reports that suggested that it was a modesty issue are misguided.
So, what happened? Short version - Melania was upset at her husband. It happens in the best of marriages. [see below]
The manner in which Melania rotated her wrist as if to get away from him (limbic brains flight response) and then hit his hand (limbic brain’s fight response when fleeing won’t do) should make that clear. Add to that, Melania immediately looked away slightly to her left – she didn’t want to deal with him. For some context watch the first 12 seconds here.
At 9 seconds into this footage, Pres. Trump already shows signs of feeling beta as his lips stretch tight with mild feelings of fear and this makes sense in the context where he is entering the stage of a diplomatic reception where protocol rules the day and a diplomat, Pres Trump is not.
Then at 12 secs he places his right hand (his dominant hand which is more significant) on his waist or bottom of his tie as if to hold onto something for comfort and up-regulate alpha feelings. Melania adjusts the bottom of her jacket at 11 secs, of course no adjustment was needed – she was experiencing mild anxiety.
The Trumps aren’t at their most comfortable in extreme controlled environments and that just makes them human.
Skip over to the handshake incident and watch from 24:10 to 24:22 and you will see that Pres. Trump had left Melania behind, she had been trying to walk alongside him but then just fell back so that when Pres Trump's gesture came, it was too little and too late. By this time Melania, first lady are not was not going to take it and so at 24:24 she gives him the nonverbal flip.
See 3:47 here where the Trumps arrive in Saudi Arabia, Pres. Trump does the same tie touch.