Thanks for all the replies.
As I said, the fail2ban filter for ssh works correctly.
That is, the sshd filter detects all the failed attempts via ssh, as can be verified with:
fail2ban-regex --print-all-matched /var/log/auth.log /etc/fail2ban/filter.d/sshd.conf
After the filter, the jail...