An insurance worker took more than £140,000 from the company he worked for to repay debts and fund a gambling addiction, a court has heard.