The past perfect continuous is used to describe an action that happened before an action that happened in the past.
I had difficulty keeping up with him because he had been walking fast
This would mean:
First, John walked fast on his own (alone) before I arrived.
Then I arrived. Then John stopped walking fast, and we walked together. Now John was not walking fast. John had been walking fast before our walk together.
That is not the intended meaning.
The intended meaning is that John was walking fast while I was with him.
So:
I had difficulty keeping up with him because he was walking fast
This means that during our walk together (not before our walk together) John was walking fast.
To try to understand this, I'll shift the verbs into the present tense for you and get you to think about two different situations.
Situation 1
Imagine that you are on the walk now with John (in the present tense).
Imagine that John is walking fast now.
John is tall. John has long legs. You are short. You have short legs.
John is walking very fast. This is a problem for you. You cannot walk as fast as John.
So you say to John: "please, John, can you walk more slowly?" John says "why?" You say "Because you are walking very fast now, and it is difficult for me to walk as fast as you".
In this situation, it makes sense to say that you have difficulty keeping up with John, because he is walking fast now.
Situation 2
Imagine that you are on the same walk again with John.
In this different version of the walk, you should imagine that John is not walking fast. John was walking fast ten minutes ago, but now John is walking slowly.
Walking slowly is easy for you.
So you would not say to John: "please, John, can you walk more slowly?" because John is already walking slowly. There is no reason to ask a person to walk slowly, if they are already walking slowly.
That is why "he had been walking fast" is the wrong answer. It means "he had been walking fast before, but then he stopped walking fast, and now he wasn't walking fast any more".