Honestly your reaction is very understandable. You tried to legitimately improve things, go the extra mile and they treated you badly for it.
But ultimately that’s not how it goes in many places.
There are a lot of people who care more about their craft than their ego. And this can be enriching beyond compensation.