Certainly, yes. Working in government service is not a secret affair. At times, an employee of a private organization may require a transfer to the place where their spouse is employed under government service. There are certain common fringe benefits like LTA available to both spouses employed in the private sector and government departments, and there can be conditional clauses prohibiting the availing of benefits from both ends.
Therefore, for the sake of collecting information, a private employer can require their employees to furnish the details of the employment of their family members even in government service.