It doesn't "count bad Wi-Fi", it just had no way of telling the difference between your Wi-Fi cutting out or you leaving manually. Even if they made a system that detected when your connection was bad and didn't punish you for it, it could be abused pretty easily by messing with your connection and purposefully getting a bad connection so you could rage-quit whenever you wanted.
Also, it doesn't matter than poor Wi-Fi made you leave the game. Your teammates still suffered from losing a player. The point of the Leaver Buster system is to make it so that there are fewer people who leave games playing at any given time, which includes the people who do so on purpose and the people with bad internet. If this doesn't happen very often, then it shouldn't affect you once you complete your five games. If your internet does drop out often enough to get you a harsher punishment, then the system is doing its job of protecting the other players from having to suffer through a 4v5.