Not all apps are in /var/www, in fact some other official apps use /opt like searx. I prefer to reserve the use of /var/www to static and php site that can be served directly by nginx.
In fact, if I was the only one to decide, I would put most apps in /opt since /var should be reserved to "files which may change in size" as described in
man hier. There are already a lot of things in /var while /opt is empty on a fresh install and is well suited for apps IMO "should contain add-on packages that contain static files."
Gogs need a linux user for ssh usage and also store data (all git repository, user avatar, issues attachments). I found more practical to have all of this in the same folder. I could have used /home/yunohost.app/gogs but I think using the standard /home/gogs makes it clearer to see that gogs is a real user with ssh access (limited to git) and data.
So in one word: clarity.