>> think it might have to do with the distance,
Distance is near the bottom with regards to things that affect air fare
>> So why are flights to Hokkaido more expensive?
Because it's a free market and that's what travellers are willing to pay for a non-stop.
As pointed out in previous posts, foreign tourists can choose to fly into cheaper cities in Japan and continue with the discounted domestic flight to Hokkaido for 8800 (Air Do) or 10800 yen (ANA and JAL). Low cost carriers might be cheaper still.
For us in North America, flying to Hokkaido or any other domestic airport (except Okinawa) with a connection costs only ~USD 50 extra one way compared to flying to the gateway cities of Tokyok/Osaka ... etc.