Gay hotels in Mexico City are closest to the Zona Rosa, the gay neighborhood in the Cuauhtémoc district. If you live here, you have the bars and clubs of Calle Amberes right on your doorstep and short distances to the Paseo de la Reforma, one of the main axes of the city. With their queer-friendly attitude, several houses in the district openly advertise. The location is also good for sightseeing, as from the Reforma you can reach the historic center and the Bosque de Chapultepec by metro or on foot.
You are not committed to the Zona Rosa. Mexico City is an open metropolis, and in many accommodations it is a matter of course for two men to book a double room. Also popular with queer travelers are the neighboring neighborhoods of Roma and Condesa, which are quieter and greener and are known for their cafes, restaurants, and Art Deco architecture. Which location is worthwhile depends on what you have in mind: night owls drive the shortest from the Zona Rosa, those who like it more relaxed are in good hands in Roma or Condesa. If your visit falls during Pride Week at the end of June, plan early, because then central houses are quickly booked up. When booking, pay attention to the city's altitude of around 2,240 meters, which the body has to get used to in the first few days.