Yes it is legal.
To sum things up, you are not paying for the content on League of Legends. You are paying for RP for the account, which you are then using to unlock content on the account. The account and all the assets belong to Riot. They allow you to use the account so long as you continue to follow their rules and conditions.
And as a catch-all, Riot includes in their ToS that it reserves the right to block access to their content for any or even no reason. But blocking someone from accessing their account for no reason would be a PR nightmare it is highly unlikely that they would do this.
This catch-all is there in case someone spots a loop-hole in the rules and conditions and attempts to blatantly exploit it (following the letter the rule while doing their best to go against the spirit of the rule).