The House tacked a school prayer amendment onto the department of education bill yesterday by a 255-to-122 vote despite charges it may be unconstitutional.

The prayer amendment, sponsored by Rep. Robert S. Walker (R-Penn.), declares that one of the purposes of the new department will be "to permit, in all public schools providing elementary or secondary education, a daily opportunity for prayer and meditation, participation in which would be on a voluntary basis." It is a simple legislative amendment, not a constitutional amendment.

An anti-busing amendment was also added 227 to 135. It is similar to language already written into many other pieces of legislation. It bars the Department of Health, Education and Welfare from threatening to stop federal aid to a school district in order to compel it to bus students for desegregation.

The House will continue debate on the measure today.

Walker said he sees no reason why purely voluntary public school prayer shouldn't be permitted. But Rep. James P. Johnson (R.-Colo.) said public prayer in a school setting may have a "coercive" character even when ostensibly voluntary. Rep. Frank Horton (R.-N.Y.) objected to the amendment as far too serious a matter to be handled as a floor rider to the education bill.

Although the House version of the prayer amendment is far weaker than similar language that the Senate considered but eventually dropped, the Walker amendment further complicates the already difficult task faced by the department of education bill. The bill is one of President Carter's major reorganization proposals.

Organizations such as the American Federation of Teachers and the AFL-CIO are already against the bill fr a variety of reasons. If the prayer language stays in the final congressional version, it could swell opposition even further by enlisting groups that consider the prayer issue more important than creation of an education department.

The American Civil Liberties Union said the language is unconstitutional and "there are elements of coercion in any school religious exercise" even when allegedly voluntary. When time is set aside for prayer a child feels compelled to participate even when told it is voluntary, critics said.

As debate on the controversial education department measure began yesterday, conservative John N. Erlenborn (R-Ill.), who opposes the bill as threatening federal control over local education, led opponents in a series of demands for quorum calls and roll calls in an effort to stall action.

He offered amendments (which were swamped) to change the department name so its initials when used in newspaper headlines would spell out DOPEY - for Department of Public Education and Youth - or DOPE - for Department of Public Education.

The bill would create a $14.5 billion a year, 24,000-employe department of education of Health, Education and Welfare programs and adding a few other programs from other departments.