How does your IP address leak this information?
IP addresses are not random things but different companies own different parts of the address range. Thus the usage of specific IP address does not change a lot, which also includes the range of IP addresses used for end users in DSL, cable or mobile networks or the IP addresses of VPN exits or public proxies.
There are several public services you can use to query the status of a specific IP. See for instance Dial-Up/Cable/ADSL IP Addresses at dns-rbl.com. Similar lists exist for known public proxies, VPN endpoints, Tor exit nodes...
Even if one can do this effectively, is it a good thing to do?
It is heavily used in fighting spam, i.e. end users are often denied to send mail to the mail servers of a specific domain directly, but must instead use the mail server of the mail provider with authentication. Since lots of spam traditionally was sent from botnets consisting of owned end user PC this blocking effectively reduced spam and thus is a good thing.
The same is with public proxies , VPN or Tor. While they have their use in providing (limited) anonymity for honest users they are often misused to circumvent access restrictions or to let an attacker or troll hide its identity when harming other users or companies. Preventing this misuse is in the interest of most and blacklisting these IP is a useful way, even though there is collateral damage against the honest users.