The formation of collisionless electrostatic shock (CES) and ion acceleration in thin foils irradiated by intense laser pulse is investigated using particle-in-cell simulation. The CES can appear in the expanding plasma behind the foil when self-induced transparency occurs. The transmitting laser pulse can expel target-interior electrons, in addition to the electrons from the front target surface. The additional hot electrons lead to an enhanced and spatially-extended sheath field behind the foil. As the CES propagates in the plasma, it also continuously forward-reflects many of the upstream ions to higher energies. The latter ions are further accelerated by the enhanced sheath field and can overtake and shield the target-normal sheath accelerated ions. The energy gain of the CES accelerated ions can thus be considerably higher than that of the latter.