It is explicitly NOT against the TOS.
Install and uninstall purchases from the App Store on Mac
In the App Store on your Mac, install and reinstall apps that you purchased with your Apple Account.support.apple.com
Apps are tied to your Apple ID, not to a specific device or even platform.
For each instance of that app, you need a license from Apple.
In fact, there is a maximum number of installations allowed, that number is typically 10.