Aaron Hernandez killed himself largely because he was suffering from CTE -- and NOT because he was agonizing over his sexuality ... so says his famous attorney.
Jose Baez -- who repped Aaron and helped him beat a double murder case -- tells TMZ ... the new documentary about his client implies Aaron was in the closet, and might have even taken his life because of that alleged secret.
That's just not the case, though, according to Baez ... who says Aaron's death was triggered by advanced CTE -- a brain disease the tight end had developed since his youth.