A common criticism of “Star Wars: A New Hope” is that the exhaust leading straight to the reactor was an obvious design flaw, and that it was clearly just there to have an easy way of blowing up the Death Star.
The death star has amazing defensive capabilities: the guns take out most big ships. Some small ships can sneak in, during a co-ordinated attacks. Presumably, the Empire is well aware of X-wing capabilities. It is unlikely they have not managed to steal even one.
The designer of the Death Star knew those capabilities. However, the death star poses its own unique design challenges. Let us remember, the reactor, even when not operating the weapon, has to sustain a moon-sized space ship. When operating the weapon, it has to output enough energy to literally blow up a planet.
This means immense heat output reequirements. The exhaust port needs to get rid of all of this heat into what is the perfect insulator: the vacuum of outer space. Presumably, some high heat-density liquid is heated up and then the gasses forcefully ejected through the port.
Now, doubtless the designer was aware that this can lead to the possibility of a bomb being dropped into the port and blowing up the station. Careful measurements were done: in thousands of careful simulations, with the empire’s best pilots, nobody could use an X-wing targeting computer to hit bombs into the port. They managed to make the port tight enough that it was impossible to hit with the best technology available to the rebels.
The empire has spent the last ten years hunting the remaining jedis. There are none left, or any that are left are deep in hiding and dare not show themselves. There was no reason to make the death star imprevious to those mythical beings, and the designer of the death star, almost certainly, was not given the mission to do so.
Addendum, in view of Rogue One¶
We know Galen Erso placed the “vulnerability” there intentionally. But he was not the only designer of the death star: this design had to pass the review of multiple people. We know that the rebellion is aware of the survival of Obi-Wan Kenobi: Leah’s message is for him. The emperor knows that, at least, that Obi-Wan and some other jedis are unaccounted for, and survived order 66. However, though the emperor and Darth Vader know it, this is not common knowledge in the Imperial forces, much less the details of the jedis’ abilities. Galen “trusts in the force”: he believes the surviving jedis will be able to use the vulnerability. The empire’s weapon designers, however, do not know jedis have survived order 66 and need to be accounted for.