Well the obvious answer is connect your computer to the router, as it works when connected that way.
The modem is what gives you a connection to the internet and this connection is often locked down to a single device, in your case the router. The router is what lets you share that one internet connection with all your devices, so the whole modem->router->computer connection path is normal.
If you *really* want to connect directly to the modem (and not share the connection with any other device), then you’d either have to reboot the modem after connecting the computer so that it recognizes the computer as that one device it’s allowed to communicate with, or you’d have to call your ISP to reset it.