After some research, I found that there are mostly relay (middle) nodes, and less exit and entry nodes. But why? The connection from the client to the entry node is encrypted, so there should be no problem.
So is it safe to run an entry and relay node, instead of a relay-only node? I am especially concerned about security, and legal considerations.
Running a guard node (aka an entry node) is safe for the person running it. The reason there aren't as many of them is because there are certain criteria that must be met before your relay can be used as a guard node:
The relay needs to have first appeared longer ago than 12.5% of the relays, or 8 days ago, whichever is shorter.
The relay needs to advertise at least the median bandwidth in the network, or 250KB/s, whichever is smaller.
The relay needs to have at least the median weighted-fractional-uptime of relays in the network, or 98% WFU, whichever is smaller. (For WFU, the clock starts ticking when we first hear about the relay; we track the percentage of that time the relay has been up, discounting values by 95% every 12 hours.)
More information can be found on these blogposts or on the Tor Project FAQ.