I'm studying English and I was taught that adverb can't follow "to be"
I think you are taking this bit of wisdom too seriously, and probably too literally.
Adverbs can follow to be, but they must be modifying something.
You cannot just simply throw an adverb out there, like, differently, and have it not modify anything at all. That defeats the purpose of an adverb. If you do not include the something to be modified in your entire sentence, it will leave readers and listeners wondering what has been modified, naturally.
I'll elaborate on your own example.
They are different
In this case, there is no adverb. There is only an adjective and it is doing its job, describing a noun.
They are differently
Now, the sentence is incomplete. They are differently, what? What are they different about? What is the difference? How is something different?
These are the questions that will plague the reader/speaker's heads while trying to decipher "they are differentlY" without any prior context.
And what does "we are hardwired differently" mean in this sentence?
What is hardwired? This should be an entire question on its own, but to make a brief explanation, it means: that we are not engineered the same. In your given context, it means that a women and a man are two different beings with different outlooks on life.
To make matters shorter, look up, "Past participles as adjectives".