Dear student,
Veins have thin walls because the pressure applied by the blood flowing in the veins is very less as compared to arteries.They carry blood from different body parts to the heart and has very less pressure.
Veins have valves to prevent the backflow of the blood because the blood is flowing in very less pressure in veins thus, there are chances that it may backflow in the direction from where it entered.
Regards