On ours it was caused by two things
1) Striker plate was too far away from the door.
2) Wall was not lined up quite right causing the door to have some tension on it when closed.
I trimmed the door edge to make the door close without tension, then some shimming on the striker plate/hinges.
In general I do not recommend just closing a door and driving down the road. It could pop open at any time and then bang back and forth until you stop. On ours I bungy the door open to make sure it does not bang around.
2015 Jayco 27RLS
2015 Ford F250 6.7PSD