Yes, there are rules against fraternization.
Basically, this is an unduly friendly relationship between two service members of different ranks that results in favoritism or other behavior that could be perceived as prejudicial.
Mostly, this applies to members of the same unit or command (akin to being besties with the CEO of your company and getting promotions or preferential treatment as a direct result of this friendship).
But the Uniform Code of Military Justice applies ONLY to service members. Note: spouses are not service members. Therefore, this rule does not apply to them.
So, spouses can be friends and socialize with anyone they desire based upon personal interest and connections or whatever.
This is in fact a thing, this whole being friends with people that you actually like without considering their spouse's relationship to your spouse.