In the Luke account it wasn a ‘spirit’ they saw. Jesus gave a very important commentary on His resurrected body. It was a spiritual body (1 Corinthians 15:44), but it was not just spirit. This was not an apparition; Jesus had flesh and bones. The issue here was belief.
But the Matthew ‘walking on the water’ account this opens up a ‘glimpse’ into something crucial - “they were terrified, and said, “It is a ghost”. The word ‘ghost’ comes from the Greek phantasma - and is only used twice. That is, this is unique.
This question actually ‘touches’ an area all believers need to consider - but many are shielded from it via traditional interpretation. The ‘second temple world view’, that is what (all) those living at this time generally believed, is crucial, but arguably not well presented in the gospels. Theologians have tended to ‘interpret’ the supernatural aspects of the gospels via a hellenised viewpoint.
Where as the second temple worldview fully accommodated a spiritual realm - one that was just as ‘real’ as the physical realm. They did not view this ‘realm’ via the philosophical ‘view’ of the Greeks.
We know this from Flavius Josephus and other literature of the times, example Enoch 1. Angels in early biblical times were ‘everyday normalcy’. Just read the accounts relating to Sodom and Abraham. Angels were seen by many, not just ‘believers’ (e.g. the shepherds).
So as to your Q “Why did Jesus' disciples believe in the existence of ghosts” - the answer is because ‘everybody’ did. They just ‘did’. They were a ‘normal’ part of ‘life’. And, no ‘big deal’. It’s only the westernised worldview that has issues with the supernatural realm. Just mention ‘Nephilim’ and watch the debate! Where as in the the period of the second temple, nobody would have battered a eyelid - they just accepted this (Genesis 6) incident - as all the literature of the time, including the Dead Sea Scrolls, reflected.
Everybody believed in ‘ghosts’.