Spurred by a spate of spy scandals, President Reagan has signed a secret national security directive that will require lie-detector tests for all government employes and contractors who have or want to obtain high-level security clearances, the Los Angeles Times has learned.

Some officials estimated that more than 10,000 people could fall under the order. About 4,000 will be State Department officers, according to one senior official, who added that an equal number of Pentagon officials and thousands more at various government agencies, defense contractor plants and consulting companies may be affected.

The presidential order, which may take months to put into effect, calls for creation of an interagency task force to write guidelines for implementation, although the mechanism for working out the specifics could be modified.

Lawsuits opposing the directive are likely, two officials said, because the use of polygraph exams has been widely questioned on grounds of reliability and invasion of privacy.

Moreover, a larger constitutional question could be posed if the directive's implementing rules require political appointees to submit to lie-detector tests. Elected officials are automatically exempt from security clearances, but appointees such as Cabinet and sub-Cabinet officials have been in a gray area.