O'Hare grabbed the only goal of a scrappy game when he forced home a corner from Kevan Hurst after his first header was blocked.
Chesterfield deserved to take the points after creating far more chances than their West Country opponents who only woke up once they were behind.
Cheltenham then switched to 4-3-3 system and desperately tried for an equaliser but it was too little too late.
Chesterfield completely controlled the first half and went close to going in front after just seven minutes.
A long throw from Mark Allott was flicked on by Aaron Downes. The ball fell to Caleb Folan whose overhead kick from ten yards out produced an excellent save from Shane Higgs.
Ten minutes later Paul Shaw, back in the Chesterfield starting line-up for the first time since September, turned his man outside the box and fired in a shot which was heading for the top corner until Higgs produced an excellent save.
Higgs saved his team again in the 28th minute when he flung himself to his left to keep out a downward header from Folan.
O'Hare eventually got the breakthrough in the 48th minute and that finally sprung Cheltenham into action.
Damian Spencer was first to react to a John Melligan free-kick but he sent his header narrowly wide.
Spencer then sent a backwards header which Barry Roche was forced to push over.
Cheltenham's best chance came in the 70th minute when a cross from Brian Wilson was knocked down by Spencer for sub Steve Guinan.
The former Nottingham Forrest striker looked certain to equalise but was foiled by a point-blank save from Roche.
Chesterfield responded with Shaw having a shot blocked by Higgs.
Ten minutes from time an excellent cross from Alex Bailey opened up the Cheltenham defence but Folan slipped at the vital moment.
Chesterfield almost grabbed a second goal in the 85th minute when a free-kick from Hurst caused panic in the box.
Downes sent in a first-time shot but Higgs made another excellent save to push the ball over the top.