means that
the anticipation and pursuit of a goal can sometimes bring greater pleasure than its actual attainment.
Imagine a case where hope and expetation are often better, more rewarding than reaching the goal itself.; then “It is better to travel hopefully than to arrive” fits well.