That's just how "samma" works, it always goes with an indefinite noun. There are a few others like "nästa" and "fel" that work similarly.
This one trips me up a lot, although it's actually quite logical. "Samma" itself is always definite, so making the noun it's talking about definite is unnecessary. To say "samma kategorin" in Swedish would be rather like saying "the same the category" in English. I suggest just trying to remember "samma" as meaning "the same", instead of just "same". Hopefully with time it will just "sound right"!
I get quite a lot of Google hits for 'belong to the same category' (10 x more than for 'in'), but maybe they were all written by Swenglishised bots in India. As a Swedish native speaker however, I'd say that belong in a category would ideally be translated into Swedish as hör hemma i en kategori. In practice there'll be a lot of overlap, but ideally.
Edit, my search above wasn't for humans, just for 'belong in/to' in general. If I look at I belong in/to the same category, I get 8,550 for in and 1,640,000 for to. It's a very rough measure, but still.
I honestly hadn't quite realized until I read this, but at least for me there's a difference in connotations between the English prepositions. To use a similar sentence:
to belong to - simply implies membership:
'I belong to the same category'
I am officially/factually a member of the category; that category is something I do currently belong to.
to belong in - feels something somewhat more like an opinion, almost like an assertion with an implicit should (and possibly implies a suggested change):
'I belong in the same category'
I should be considered a member, or I should do something to be recognized as one, or even it is good/correct that I am already a member; that category is something I should belong to, whether or not I officially do.
Overanalysis aside, is that anything like the difference you were explaining between tillhöra and höra hemma i? I wouldn't be surprised to hear so, given the English connotations of the word 'home' (I almost described my second usage as 'is/would be at home in')