The key to these is that, for the most part, the London tube is, in fact, a tube (or rather, many tubes). To build most of the Underground, they hollowed out circular tubes under London with boring machines, through which they ran tracks and trains. As a consequence, most lines are a single “tube” in each direction, without a lot of track switches or cross-overs underground. There are also few track connections by which trains from one line may be rerouted to another. In addition, many of the tubes are very deep underground (enabling their use as bomb shelters during the London Blitz, among other things).
In contrast, most of the New York City subway was built by “cut and cover”, digging down from the streets , excavating a large trench, and covering the excavation with a roof that becomes the street above. A significant portion of the system is built with four parallel tracks, one local and one express in each direction (sometimes three tracks, with one reversible express track in the middle). There are quite a few points where trains from one line may be diverted to another to avoid a section of track being worked on.
On the air conditioning question, what you have is a bunch of tubes cut deep into the soil under London, only connected to the surface by the exit stairwells/escalators. There was no provision for air exchange when the tube was built, and there is a real problem with getting the hot air out and cool air in. Note that the New York subway is not air conditioned, though most stations and large portions of the track are vented directly to the streets overhead.
On the 24 hour question, to maintain a particular line, they would essentially have to shut down the whole line to do maintenance. In New York, they have daily work trains that, for instance, go station to station to pick up the garbage. (The famous money train, which picked up fare collections, is no longer, made obsolete by Metrocard vending machines that take credit cards.) When a work train is running, there are enough places where the daily work trains can be switched and diverted so that a reasonable (nightitme) flow of passenger trains can be maintained.
When there is other work to be done on the tracks, it is usually fairly easy to set things so stations can be serviced while one of the tracks is taken out of service. For instance, if there are a local and express track in each direction, for work on the express track, trains can just be diverted to run on the local track. For work on the local track in one direction, say downtown, they will often divert all downtown trains to the express track, but leave the uptown local track in operation, so someone needing a local station but travelling downtown can get on at the local station going uptown and reverse direction at the next express station.
There are other more complex diversions that can be done for sections where there is only one track in each direction. In fairly common situation where there are two alternate routes between stations (e.g. both the A/C and F lines go between West 4th Street in Manhattan and Jay Street in Brooklyn via different routes), they may close one in one direction, with customers on the partially closed line having to take the train in the operating direction and reverse where the lines rejoin. Sometimes, they will close down a segment of track between two stations, run a shuttle back and forth on the other open track, and meet up with trains looping back and forth on the two disconnected ends of the lines.
Of course, sometimes these don’t work, and you get the dreaded “bustitution”, where you climb into the open air and take a bus over the subway route, but these are relatively rare considering the size and complexity of the system.
Because of the way it was built, London just doesn’t have all of these options for diversion, which make 24 hour operation of the system possible.