There are a couple system at work. The plants will take some of the Ammonia and use it for the nitrogen they need, this bypasses the bacterial cycle. The rest of the ammonia would get taken up by the nitrogen cycle bacteria, which results in a continuous production of Nitrate that the plants don't like using. The result is the Nitrate builds up over time in the tank because there is no mechanism to remove it. The only way to prevent the buildup of nitrates is to have the plants process all of the generated ammonia in the tank, or more simply to remove the built up nitrate from time to time during the water changes.
Your situation is more complicated by the addition of fertilizers which may or may not contain nitrogen compounds used by plants, but also which affect the Nitrate levels.
In the past I am sure that people kept tanks with high Nitrate values >20 ppm, but as some people have already mentioned some fish start to show sensitivity to higher nitrate values. In general health affects due to Nitrate are slow to develop. At 40 ppm I would say your Nitrate is high but if your fish and shrimp seem OK then perhaps it is not an issue, it is likely you do not have very sensitive fish. I have some ornate tetras that seem to be sensitive to nitrates, they don't die or even behave that much differently but the closer to 20ppm Nitrate the more pale their coloration seems to me.
Really apples to oranges but I have been checking the Nitrates in stagnate bodies of water around my home and I haven't been able to find any traces of nitrate in natural water sources. The only place with any Nitrates had significant runoff from a dairy farm. Given it isn't common in natural environments suggests that maybe we should keep it low in the unnatural fish tank.