>>858785The overnight trains from Spain to France, Switzerland and Italy were taken out of service coinciding with the opening of the HSR connection to France. However, in France there's no continuous HSR line until the Spanish border, so travel times for HSR between Spain and France are pure shit (over 6 hours Barcelona-Paris), and consequently demand is low (2 daily trains between Barcelona and Paris at present). The night trains were retired in an attempt to leave HSR as the only option, and thus increase demand somehow.
Nowadays there's still daily night trains in France from Paris all the way to the Spanish border, so you can still take a regional train to the border and a night train from there. The HSR link to France was a Spanish enterprise, and the spanish statal railway company Renfe was responsible for the international night trains, together with the french SNCF. The present night trains that run to the border are purely french run, so they weren't retired.
Adding to that, the international overnight trains weren't purely "bunk-bed" sleepers, they only had a few coaches for that, and others with roomettes with and without bathroom. Only the bunk beds were pretty cheap, and they'd often be full, while it's the roomettes that were completely underused.
tl;dr, cheap overnight trains are still in demand, they're just being retired to favor HSR