Question: I was wondering why executables (written in c++) have to be recompiled from sources on every linux machine, even if the machines are software and hardware the same?

I had a search engine, written in c++, and I have to recompile it every time I want to move it on a new linux machine to make it work.

Any ideas?

Answer: 
If you are asking why an executable compiled on Linux-X won't run on Linux-Y, then the reason is probably that dynamic libraries (.so) are missing or could not be found. 

EDIT: oh sorry, looks like I didn't read your question well enough. Removed the sarcasm.
The recompilation is ensuring you get optimal performance on your machine, because each time the configuration script is running to find dependencies and settings. This also ensures the openness of software as its source is always available and is modifiable by an appropriate agents - that is us.