Many servers actually run off of player donations, and some people are even able to live off the extra money that doesn't go into to the server! But how does this process work?
You may have seen shop pages for servers. If you haven't they typically look like this (EcoCityCraft's Shop). If that seems familiar, it should. In fact, almost every server webstore will look similar to this, this, or this (HiveMC, ClownerCraft, and The Chunk store pages). They are all powered using a service called BuyCraft. BuyCraft allows you to setup a webstore, and then send custom commands to the server when you buy a rank. For example, I could create a "package" (or virtual product) that, when bought, would send multiple server commands to set a player's rank, give him ingame money, and broadcast to the server.
It has many, many features, and extremely customizable. Not only can you edit the default CSS of multiple themes, but you can even edit the HTML too! This means that you can have a completely custom store that makes easy updates every time you add a package. Another cool feature is that you can have subscription packages which can charge the buyer after a custom time, and can send commands each time. This could work for temporary ranks that you would have to pay a monthly subscription to, and, when the subscription expires, would demote the player back to the previous rank.
Buycraft is free, though with many limitations unless you upgrade to a different plan. For example, the free plan only allows one payment gateway (the method through which you receive payments) and five packages. The next plan costs ~$6 a month, and allows you to have unlimited packages, categories, and gateways, but only allows you to earn $2500 or less per month. The final plan has many more features for huge servers, and costs ~$30 a month.
I setup a quick webstore, partly for the idea of Mine Monthly Events that I had, and partly to test some of the Buycraft features. Currently, the packages actually do send commands to the server, but the server itself is a local one (you can't join it). You can visit it here.