Global warming is one of the causes of disease outbreaks in fishes. Understanding its mechanisms is critical in aquaculture and fisheries. We used tilapia to study the effects of a high temperature on the infection of a bacterial pathogen Streptococcus agalactiae using RNA-Seq. We found that the dissolved oxygen level in water at 32 °C is lower than at 22 °C, and tilapia infected with the pathogen died more rapidly at 32 °C. The gene expression profiles showed significant differences in fish raised under different conditions. We identified 126 and 576 differentially expressed genes (DEGs) at 4 and 24 h post infection at 22 °C, respectively, whereas at 32 °C, the data were 312 and 1670, respectively. Almost all responding pathways at 22 °C were involved in the immune responses, whereas at 32 °C, the enriched pathways were not only involved in immune responses but also involved in oxygen and energy metabolisms. We identified significant signals of immunosuppression of immune responses at 32 °C. In addition, many of the enriched transcription factors and DEGs under positive selection were involved in immune responses, oxygen and/or energy metabolisms. Our results suggest that global warming could reduce the oxygen level in water and impair the defence of tilapia against bacterial infection.