Is there any reason (code or otherwise) to not vent one room into another?
There is no code against ventilating your closet into the other room.  There are all kinds of crazy things I have seen to take a room that has great ventilation and move it to another room.   If you go in the south of France you will see fans between the living space that has outdoor access in the connecting rooms.  

The only issue becomes if you had toxic fumes (which you wouldn't in another interior room) and this is common with a work area or garage (cars).  

As far as going through the attic well attic fans exhaust attic air into your living space and attic air probably isn't as clean as the other air you are breathing as attics often have mold, dirt, and open insulation.  You are just tunneling through using appropriate piping which should be metal ducting or PVC.

Let me tell you why what you are doing is a good idea - since we should all look to make our houses energy optimal - but very flawed at the same time.  It is flawed because during the periods of the year that are cold and you want the next room warm you will be going through a cold attic.  The output of whatever your server generate is no way a furnace, the ducts will get cold and you will end up spitting out cold attic temperature air to the next room.  The fact is the fan plus cold air will cost you energy money.

Really you want to just vent right to the attic when it is warm out.  When it is cold out you want to vent right to the other room.  You could do this with decorative grating/cover between the rooms and possibly the use of a fan in the grate itself.  There are probably a lot of unique ways to create airflow between the rooms, with pipe/duct being an option but not an efficient one as it will not necessarily capture all of the heat and if it does will require a lot of power from a fan.  Nothing wrong with using a fan but it shouldn't need to be on all the time and shouldn't need to require that much force.