In this study, we adapted a prior identity framework to investigate how students' perception of the inclusiveness of the learning environment (including sense of belonging, peer interaction and perceived recognition) in an introductory physics course predicts their course grades and physics motivational beliefs (including self-efficacy, interest and identity) at the end of this course. We found signatures of inequitable and non-inclusive learning environment in that female students' mean scores for sense of belonging, peer interaction and perceived recognition were all lower than male students' in the course. In addition, we found that female students had lower average course grades than male students. Using structural equation modeling, we found that students' perception of the inclusiveness of the learning environment predicts their self-efficacy, interest, identity and grades at the end of the course even after controlling for students' gender, motivational beliefs and grades in a previous course as well as their high school GPA and SAT math scores. In particular, students' perceived recognition, e.g., by instructors and teaching assistants, played a major role in predicting students' physics identity, and students' sense of belonging in physics played an important role in explaining the change in students' physics self-efficacy. Our findings can be helpful for creating an inclusive and equitable learning environment in which all students can excel.