That’s not quite correct. Biden joined as a Reserve Public Affairs Officer - not as a line officer. And the Navy at least does do that on occasion. It still stinks, though it actually was nepotism versus buying a commission.
Jao Bai-din bought Hunter Biden's commission as directed by their Chinese and Ukrainian crime counterparts and Obama approved it.
I suspect the Navy brass so willingly threw him out a month later, not for failing his drug test (not like he'd ever pass one prior to commissioning), but because so many of the other Navy commissioned officers said they'd resign.