Various reasons. One is to check that the driver is not looking at his phone or watching videos while driving (because they have so much downtime, truckers often have a tablet or laptop to watch movies on), i.e. the same reason there are cameras watching the drivers of trains. Truckers occasionally try to bring their spouses along, which is against the company’s rules, or they make use of prostitutes on the road, and a camera lets the company ensure that no one is ever inside their truck but the driver.