It is only a matter of time before (something happens)
means
We are not going to need to wait very long before (something [will/is going to] happen).
So
It was only a matter of time before (something happened)
(the past tense form of the same expression)
means
We were not going to need to wait very long before (something [would/was going to] happen).
In short, this part of the sentence is written from the past point of
view. The writer knows what happened, that is, he knows
what was going to happen, and he tells this from the
point of view of someone who was there in the past.
He is saying:
We were at a point in time where not much more time
was going to pass before this happened: Money transformed ...
love and marriage. And, he adds,
this is like what money has done already, namely, money has transformed almost everything else ... This last addition is back in the present point of view, of course.
CJ