He DIDN'T get an infection because the writers didn't write one into the script. It would have made for a very short tragic story. If they had applied more realistic consequences, he would have quickly died of the numerous infections without antibiotic and proper medical treatment. The penetrating wounds, cuts, gashes, blisters and lacerations he received from the coral and drift wood are notorious for depositing bacteria and foreign objects into the body resulting in infection and blood poisoning. Ocean water itself is full of microbes, bacteria and particulates. Sorry but an exceptional suspension of disbelief is required for this plot device to work.
He always wanted a truck and was weighing the possibility of stealing it... and the girl.