I don't know what might be the cast at JFK T8, but at many airports/terminals, certain gates are restricted to aircraft of a certain size.
So, your flight might have used a gate for which the 767 was the largest possible aircraft, so that other gates would be available to park 777's later in the afternoon/evening.
Or, it might be that the closer-in gates (closer to security checkpoint/lounges as well as FIS) were being saved for turns whose outbound was higher yielding than the one your plane was scheduled to fly.
Or, maybe your plane was due to be taken out of service for mechanical work (or not flown again until may hours later), and putting it on the end of the concourse meant it could be towed away without affecting arrivals/departures at the closer part of the terminal.
Or, as you noted, your flight was late-arriving, so you might have gotten the "spare" gate to keep your plane from screwing up the gate assignments of multiple other departures, for which baggage/catering/service items might already have been staged at the more desirable gates.
Like I said, I don't know what the particular situation was with this flight, but these are the sorts of considerations that go into gate assignments... none of which makes your delayed arrival into the farthest gate any more pleasant.