Why pg_wal dir does not clean up while logical replication
archive_mode is used for for archiving, regardless of standby configuration. It can be used for point in time recovery. So when you perform DML on any table, it will generate WAL.

For cleaning up you can use archive_cleanup_command from recovery.conf