Doing nothing but farming in lane and actively avoiding fights is not technically a bad thing. They are denying pressure against objectives, and in theory, they are less likely to give kills (gold and experience) to enemy champions.
I also typically hear people complaining about junglers that afk farm. I'm not aware of any champions that are NOT capable of clearing their whole jungle with time to spare before one of their camps respawns. So if they are really doing nothing but farming, they are either literally afk sitting there(which is punishable), or they are invading and farming the enemy's jungle, .. which is helping the team by denying resources from the enemy jungler, potentially putting them behind.
Neither of these are ideal strategies.
Ganking and responding to pressure across the map are WAY more helpful to your team.
Unfortunately, there is no fair way for Riot to distinguish between someone that is intentionally being unhelpful and simply making a bad decision, and therefore there is no way for them to really punish someone for doing so ... without EXTENSIVE history which includes the matches where they are responding appropriately and refusing to respond at all. Chat logs might also provide evidence against them..
Also, they might be accused of 'bot-ing' or if the behavior is so unusual for the player it could be assumed that their account is being accessed by someone else.