Yes, absolutely. A well-specced machine with a strong CPU, plenty of fast memory and a solid network connection makes an excellent game server.
Two caveats: server hardware is not automatically the right choice for gaming, and a machine hosting games for others needs proper access controls before it faces the internet. Get that part wrong and the box becomes someone else's problem very quickly.