How does Matomo work better with a static site, than GoAccess? GoAccess reads the server logs and creates metrics. Matomo requires javascript; that isn't 'static website'.
Also usage of javascript doesn't make one page non-static. Static is usually referred to a page that is rendered in full before a request comes in so the content does really change based on the request. More simply, content doesn't change dynamically based on the request. Having javascript to generate metrics doesn't make the page dynamic.
Analysing server logs also makes it harder to filter bots, and won't include some useful metrics like screen size.