In recent years, heterogeneous radio access technologies have experienced rapid development and gradually achieved effective coordination and integration, resulting in heterogeneous networks (HetNets). In this paper, we consider the downlink secure transmission of HetNets where the information transmission from base stations (BSs) to legitimate users is subject to the interception of eavesdroppers. In particular, we stress the problem of joint user association and power allocation of the BSs. To achieve data transmission in a secure and energy efficient manner, we introduce the concept of secrecy energy efficiency which is defined as the ratio of the secrecy transmission rate and power consumption of the BSs and formulate the problem of joint user association and power allocation as an optimization problem which maximizes the joint secrecy energy efficiency of all the BSs under the power constraint of the BSs and the minimum data rate constraint of user equipment (UE). By equivalently transforming the optimization problem into two subproblems, that is, power allocation subproblem and user association subproblem of the BSs, and applying iterative method and Kuhn-Munkres (K-M) algorithm to solve the two subproblems, respectively, the optimal user association and power allocation strategies can be obtained. Numerical results demonstrate that the proposed algorithm outperforms previously proposed algorithms.