We study charge states of a superconducting single-electron transistor (SSET) fabricated on a heterostructure substrate that can be switched from insulating to conductive. We probe the charge states by microwave irradiation and subsequent observation of photon-assisted Josephson quasiparticle current, which allow us to obtain the energy dispersion relation in the quasicharge space. When the substrate is insulating, the charge states show an energy-dispersion curve with a gap, manifesting that coherent superposition of the two charge states is realized. When the substrate becomes conductive, its two-dimensional electrons capacitively couple to the SSET and modify the degree of dissipation to its electromagnetic environment. The dispersion relation then becomes linear, and its slope agrees with the value estimated from the charging energy including the capacitance of the two-dimensional electrons. This indicates that quantum coherence between the two charge states is lost due to the coupling with the environment.