A man who stole metal which he sold on for scrap has been ordered to do 180 hours of unpaid work and pay compensation of £1,700.