Why is a different particle used with the positive and the negative version of 必要がある/必要はない?


In the expression V必要がある / V必要はない, which I came across in my textbook, I would
expect that both use the particle が. What is the reason why は is used only in
the negative case?

This is the source:

![enter image description here](https://i.stack.imgur.com/Vq0WS.jpg)

よろしくお願いします！

