This study investigates the impact of corporate board composition (CBC) on corporate philanthropic expenditure (CPE) before and during the COVID-19 pandemic. It also examines how firm profitability moderates the association between CBC and CPE. Using a panel dataset of 264 firm-year observations from listed banks in Bangladesh from 2015 to 2022, the study finds that both board size and board independence positively and significantly influenced CPE before and during the COVID-19 pandemic. Conversely, board gender diversity significantly negatively affected CPE before and during the pandemic. These results remain robust when alternative measures and models are applied to address potential endogeneity concerns. Furthermore, the interaction effects of firm profitability with board independence and gender diversity on CPE are positive and statistically significant. Notably, the positive interaction of female board representation with firm profitability highlights the critical role of women in bridging shareholder interests with social community needs. This study is the first to explore the roles of firm performance in the CBC-CPE relationship, offering new insights into how firm financial performance and board attributes jointly influence CPE. It also advocates for global initiatives to enhance female representation on corporate boards, underscoring the critical role of female directors in evaluating corporate contributions, safeguarding investor value, preventing resource misallocation, and ensuring financial support for philanthropic activities when firm profitability allows.