The reason for this is that, by this time, Buck is really hearing the call of the wild very strongly. It is only his love for Thornton that keeps him from following the call completely.
So the reason that Buck wants to hang out with the wolf is that they wolf represents what Buck really wants to be. He is like a dog, but he is wild and free. He is the way dogs used to be (in the visions that Buck has of the past).
So this is really a way of showing that Buck is getting so close to just becoming wild (as he will when Thornton gets killed).