Then you'll need to defend it, which can be hard to do against entities based in non-compliant countries such as China. To cover US, EU, and large Asian markets, you're looking at $500k-1m, and thats just to get the patent. To patent an idea will probably be around $10-100k per market.
The fact that software is typically shipped virtually means that borders are practically non-existent, and wide patents are often needed, or a company needs to give up on defending their patent outside their primary market. In particular, costs are high, litigation to protect is expensive, and so your average student wouldn't be able to afford this. There are many reasons that make them less effective at this than their ideal.