Background: The coronavirus disease 2019 (COVID-19) has become a worldwide public health crisis. At present, there are no effective antiviral drugs to treat COVID-19. Although some vaccines have been developed, late-stage clinical trials that allow licensure by regulatory agencies are still needed. Previous reports have indicated that severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) and SARS-CoV are highly homologous and both use angiotensin-converting enzyme 2 (ACE2) as the receptor to enter cells, and SARS-CoV infection reduces the ACE2 expression in the lung. Therefore, the analysis of genes co-expressed with ACE2 in the lung may uncover the underlying mechanism of COVID-19. Finally, we used the Connectivity map (Cmap) database to search for candidate drugs using transcriptome profiles of patients with COVID-19. Method: Based on the differentially expressed genes (DEGs), indicated by the expression of RNAs isolated from bronchoalveolar lavage fluid (BALF) cells of patients with COVID-19, we performed functional enrichment analysis and hub gene cluster analysis. Furthermore, we identified genes co-expressed with ACE2 in healthy lung samples and analyzed the significant genes. Additionally, to identify several candidate drugs for the treatment of COVID-19, we queried Cmap using DEGs and genes co-expressed with ACE2. Results and Conclusion: The up-regulated genes in the BALF cells of patients with COVID-19 are related to viral mRNA translation. The down-regulated genes are related to immune response functions. Genes positively correlated with ACE2 are related to immune defense and those negatively correlated are enriched in synaptic transmission functions. The results reflected prosperous viral proliferation and immune dysfunction in patients. Furthermore, ACE2 may not only mediate viral entrance, but also play an important role in immune defense. By using Cmap with transcriptome profiles of patients with COVID-19, we identified candidate drugs for the treatment of COVID-19, such as amantadine and acyclovir.