This is actually a very tough question to answer (what is appropriate, that is what is just). You can even go back and wonder about patents themselves and some of the misbehavior associated with them (patent trolls, submarine patents, "business process" patents, etc.) Then there are copyrights and the (literal) Mickey Mouse extension in duration. However, this is a real rathole to dive down (moral justice).
Instead of dwelling on justice question may advice is to reframe a little and think about what is legal and what is customary. Basically our society has decided to allow these patenting behaviors. The rationale (not saying if I agree or not, just sharing the concept) is that by $$ incentivizing researchers (even those already getting state funding) that the benefit is worth the cost.
However, there are obvious differences where the research is in areas of national security (and even publication may be limited). Also industry almost always makes paid researchers sign over their rights for discoveries as part of the employment contract. So obviously other models are possible. [However, these researchers generally have higher salaries. And higher job security, at least versus grad students.] So, obviously other models are possible.
My advice is not to get too flustered by the moral issues here and just deal with the system as is (in your institution). Also, note that the VAST majority of patents don't earn any money. If anything there is a little bit of a game with more senior researches (in academia and industry) being better able to get the IP department to spend more time/money pushing their patents through the system. The reason for this is prestige, not economic value.
For a practical example, the institution I worked in (academia) had a policy that some fraction of the value accrued to the school and some to the researchers. BUT if they decided not to spend the money on a patent filing, than you could do it on your own and get all the value. This created possibility of perverse behavior where if you really discover lighting in a bottle, you would want to DOWNPLAY it, but disclose it.
I did push one patent through the system, described above. It was not lighting in a bottle but I felt like it was closer to a real innovation and had greater likelihood of $$ earnings than some of the stuff the senior faculty was pushing through [one name professor was the husband of the head of the IP department...surprise, surprise, he was the leading patenter on campus!] Or at least that was the story I told myself when dressing up my research and convincing the IP department to spend the money. ;-)
Some final related practical advice.
If you push a patent, get a copy of Patent it Yourself (Nolo Press). Don't actually patent it yourself...use an agent (preferably on someone else's dime). But it will give you the basics of how things work.
Read a few (include them in your lit searches).
Learn how to write one. The patent agent will still "write it" but they do a lot better job when a researcher has done the meat of the work ahead of time. Better patents are sort of like lab reports with description of examples, materials of construction, testing, etc.
I actually just gave the agent a draft. I see bad things happen when people just dump some drawings or figures onto an agent. He knows some things you don't about patent law but he can mess up the science/engineering logic and this can cause issues during the patent office examination or if the patent is ever litigated. [This could be a personal thing though...I take the same attitude with publications...write them myself so it is the way I want it.]
Also, there is a sort of way of justifying things. "It is well known in the literature that technique A can be used to get effect B but at the cost of issues C. Issue C is a serious hindrance in trade (cite). We present a new method by mixing some D in with the A to get effect B, with a 50% decrease in C."
Buy and read the book Laser: https://www.amazon.com/Laser-Inventor-Laureate-Thirty-Year-Patent/dp/0595465285 The book describes a grad student who had a 30 year patent battle over who invented the laser. He "won" (perhaps it was settle, but I think he prevailed) because he had gotten his lab notebook notarized by a drugstore clerk! Few practical lessons from that: use your notebook, know when you have lightning in a bottle (almost literally in his case) and be prepared for some fight if the thing is actually worth something.
I have had a patent fail because it was a year after publication. (I misjudged the time because I didn't realize Chem Abstracts was considered publication and was just thinking about the "real journal". So don't cut things too close. [That said, in all likelihood, you are just an academic trying to get prestige, so figure out how to get both a publication and a patent out of the research.]