How do I attach a page to a category similar to how we attach media to a post?

No, media is attached to posts/pages using the post_parent column. This works because media is actually a post of type attachment in the database.

Categories however are not posts, and the way you would attach them is by assigning the page to that category.

This leads us to a contradiction, how do you attach a page to a category without attaching it to a category?

I’m sure that your original problem is solvable but this is not the solution.