However, on the oscilloscope I can see quite large oscillations on the drain.
Interestingly, it changes quite significantly depending on duty of PWM signal fed to the gate.
The ringing disappears completely when duty is over 70%.
Circuit is powered from 12V car battery.
How can I prevent such oscillations?
It is back-EMF. You can add a 100n film or ceramic cap across motor terminals to mitigate ringing.
Duty cycle plays a role, because there are two different modes of operation, if you look at motor winding (inductor) current.
In continuous conduction mode (CCM) there are two phases in a cycle:
1 Switch open, diode closed, motor winding current is flowing throught switch.
2 Switch closed, diode open, motor winding current is flowing throght diode.
In discontinuous conduction mode (DCM) there is aditional third phase in a cycle:
3 Switch closed, diode closed, motor winding current is zero.
In phases 1 and 2 the drain node is connected either to gnd or to +12V, so you can't see back-EMF on scope. In phase 3 this node is in high-Z (between rails) and you can see ringing on scope.