1 inch per gallon is a very rough and ready measure of calculating aquarium capacity. It can be useful for estimating such things, but should be taken with a pinch of salt and shouldn't replace actual experience of keeping individual fish.
Its a good gauge for judging if an amount of water of will support the bioload but doesnt account for other needs of fish.
For example, you couldnt keep a 10 inch fish in a 10 gallon tank. But you may be able to keep 10 x 1 inch fish in a 10g tank or 10 x 10 inch fish in a 100 gallon tank. A fish needs a certain amount of space to comfortably live in, have enough room to swim around in. Too small a tank will stunt fishes growth, lead to ill health and shorter lives.
Some fish produce more waste than others and the 1 inch per gallon wont work so well there either. Temperate fish are messier than tropical fish so you cant stock as heavy there. Some fish need better water conditions than others, so again you shouldn't stock as heavily if you plan on keeping more sensitive fish species. So 1 inch per 2 gallons or 1 inch per 5 gallons may be a better ratio.
Most of the small tropical fish people keep are social fish. They do better if kept in groups. So while a small tank might be able to support 1 or 2 small tetras from a bioload PoV those fish need to be kept in groups, so a bigger tank is needed to support the group. These small fish are also active swimmers, so we go back to the comment regarding a fishes other needs and they need a big enough tank to support their active natures. You may need a 20g tank for an active tetra, that tank may support 20 of those tetras, or 3 groups of 6/7 tetras and thats where community tanks arise from.
Take a look at
AqAdvisor - Intelligent Freshwater Tropical Fish Aquarium Stocking Calculator and Aquarium Tank/Filter Advisor
While this again isnt a fool proof method of calculating aquarium fish capacity, it does take account other factors than bioload such as filtration, space needed, it gives some advice on numbers of fish needed and compatibility between fish species. The database has been built up over a long period and many experienced fish keepers have had input into it and continue to do so.