WASHINGTON (AP) _ President Reagan said in an interview broadcast Thursday that some homeless people sleep on grates or on the grass from ''their own choice'' instead of going to shelters.

In the television interview with ABC News, Reagan also said the possibility of Soviet President Mikhail Gorbachev being ousted ''has to be considered'' although he has seen no indication of it.

ABC's David Brinkley asked Reagan for his views on the homeless, noting that some of them sleep in a park about 200 yards from the Oval Office, where the interview was taped on Wednesday.

The president responded, ''Doesn't that go back - that there are always going to be people - they make it their own choice for staying out there.''

''There are shelters in virtually every city and shelters here and those people still prefer out there on the grates or the lawn to going into one of those shelters,'' he said.

Mitch Snyder, a nationally known advocate for the homeless who runs a shelter in Washington, reported during a bitterly cold spell earlier this month that people had to be turned away from shelters already filled beyond capacity.

Asked whether the opposition to Gorbachev in the Soviet Union was strong enough to force him out, Reagan said that ''up until now the government of that huge country or nation is the communist party, which is really a tiny elite of the population of the Soviet Union.

''But they literally appoint, so it is possible for - and we've seen it in the past - Soviet leaders to suddenly be ousted. I don't see any indication yet or threat of that, but I think it's something that has to be considered if you look at their past history.''

In a portion of the interview that was broadcast on ABC's Wednesday evening news program, Reagan said that the United States and its allies were ''discussing'' the possibility of taking military action to destroy a huge chemical weapons factory in Libya, although no decision has been made.

In the hour-long interview, the president also suggested that ''maybe our founding fathers made something of a mistake in the method of reapportionment,'' by which state legislators redraw congressional district lines after each census.

''I think that a bipartisan citizens committee representing both parties and top-ranking citizens would perhaps do a job that would be based on the needs of the district,'' he said, repeating criticism that the present system is too partisan.

The president also elaborated on his recent attack on an interlocking ''iron triangle'' of members of Congress, the news media and special interest groups.

He said that ''the media, which reports on what's going on here in this company town ... well, let me say that the incumbents have more access to th press than some unknown newcomer ... Also, the interests of many of these special interests, the press is aware of and comments on and so forth.''

On the subject of the homeless, Reagan also said that ''a large proportion of those people'' were homeless because of changes in laws with regard to the mentally impaired ''that they could only be committed to an asylum or a mental hospital if they represented a threat, a danger to others or to themselves.''

''And the result of that was that all across this country ... people particularly in - you call it retarded - walked away from those institutions, they wanted freedom, but they walked out to where there was nothing for them.''

Reagan, who told Brinkley that ''I like people. I really do,'' was asked for his views on some individuals, including former White House chief of staff Donald T. Regan, who wrote a book critical of some of the president's working habits and of the predilection of his wife, Nancy, for astrology.

''I was shocked by some of the things that he chose to say in his book,'' he said.

He also said that he has been frustrated by congressional opposition to his program of aid to rebels fighting the Sandinista regime in Nicaragua, but some lawmakers who have been to Nicaragua ''are totally on our side in getting rid of that government.''