We investigate the spin Hall effect in perpendicularly magnetized Ta/Co40Fe40B20/MgO trilayers with Ta underlayers thicker than the spin diffusion length. The crystallographic structures of the Ta layer and Ta/CoFeB interface are examined in detail using X-ray diffraction and transmission electron microscopy. The thinnest Ta underlayer is amorphous, whereas for thicker Ta layers a disoriented tetragonal beta-phase appears. Effective spin-orbit torques are calculated based on harmonic Hall voltage measurements performed in a temperature range between 15 and 300 K. To account for the temperature dependence of damping-like and field-like torques, we extend the spin diffusion model by including an additional contribution from the Ta/CoFeB interface. Based on this approach, the temperature dependence of the spin Hall angle in the Ta underlayer and at Ta/CoFeB interface are determined separately. The results indicate an almost temperature-independent spin Hall angle of theta_SH-N = -0.2 in Ta and a strongly temperature-dependent theta_SH-I for the intermixed Ta/CoFeB interface.