Investopedia has an interesting article, search "dormancy fee", but it's about credit cards, still doesn't seem like it could be legal for Paypal either.
That article says it's now illegal for credit card specifically but legal for other things like gift cards and bank accounts, so it's probably legal for Paypal as well.