Submitting checkbox data from a front-end form for a 'Categories' Field Type
I just tried your code and it worked.

Is your entry getting saved at all? If not I assume there might be another error. Add this to your code to output all form errors:

{% if entry is defined %}
    {{ dump(entry.getErrors()) }}
{% endif %}


Although it didn't made a difference in my test, you should remove the space to be sure:

value="{{ category.id }}"