Urban community gardens (UCGs), greenspace cultivated and managed for vegetables by local communities, provide substantial ecosystem services (ES) and are warmly welcomed by residents. However, they also have many ecosystem disservices (EDS) and are almost always refused by the decision-makers of the government, especially in China. Better understanding the residents’ perceived ES and EDS and the impact on the behavioral intention (BI) toward UCGs is of great value to solve the conflicts between residents and the government concerning UCGs and to develop sustainable UCGs. Following the theory of planned behavior (TPB), we measured perceived ES/EDS, attitudes (ATT), perceived behavioral control (PBC), subjective norm (SN), and BI of 1142 residents in Changsha, China, and investigated their direct and indirect causal relationships using structural equation modeling (SEM). The results showed that: (1) ATT, PBC, and SN significantly and positively impact the BI of UCGs and together explained 54% of the variation of BI. (2) The extended TPB model with additional components of perceived ED/EDS improved the explanatory ability of the model, explaining 65% of the variance of BI. Perceived ES and perceived EDS showed significant direct positive and negative impacts on UCGs, respectively. They also indirectly impacted BI by influencing ATT, PBC, and SN. The findings of this study can extend our understanding of residents’ attitudes, behavior, and driving mechanism toward UCGs, and can help decision makers to design better policies for UCG planning and management.