Spin-squared Hamiltonian of next-to-leading order gravitational interaction