Without 것, 가는 is an adjective phrase that describes the noun that immediately follows. E.g.
가는 남자가 - the man (that is going)
You need the 것 to refer to make a gerund that refers to the general act of "going". E.g.
잠을 자는 것은 좋다 - Sleeping is good.
I suggest reviewing the tips and notes for the Gerund skill accessible from the mobile/desktop website (not the app unfortunately)