There are (at least) two valid ways to parse this, but the context eliminates all but one.
[Drinking(adjective) tea(noun)](subject) is(verb) [good for health](complement)
Here the phrase drinking tea is adjective-noun structure
[Drinking(gerund) tea(noun,object of drinking)](subject) is(verb) etc.
However while "Drinking chocolate" is idiomatic, "Drinking tea" is not an idiomatic phrase and so is rejected. Therefore the "gerund" parsing is correct, and "tea" is the object of drinking.
Computers would have trouble with this, and, indeed https://www.link.cs.cmu.edu/link/submit-sentence-4.html finds both alternatives but incorrectly finds that the adjective-noun structure is more likely (generally adjectives are more common than gerunds in English, and the parser doesn't have access to a database of collocations that could avoid this error.