The House Ways and Means Committee yesterday approved a controversial tuition tax credit bill - but only after stripping it of aid for elementary and secondary school pupils that had been sought by Catholic and other private school groups.

The bill the panel reported would allow parents of college students to reduce their federal income taxes by 25 percent of tuition costs for each child, up to a maximum of $250 a student.

The tax break would be phased in gradually over three years. The write-off would start Aug. 1 at $100 a student. In 1979, it would rise to $150 a student. And in 1980 it would climb to $250. The bill would expire after that.

The committee's action pits the tuition credit legislation against a rival Carter administration plan that would expand existing federal college schoolarships instead. The Senate had pending a tax credit bill that would include parochial schools as well.

The action came only minutes after President Carter, appearing on nationwide television, raised the possibility that he might veto the tuition credit legislation if he decides it is both "costly and unconstitutional."

Carter said he was oppoesed to the tuition tax credit "under any circumstances" because he believes it is "very detrimental to the future of education in our country." However, he said until the bill is on the desk, he could not make a final decision on the veto question.

The key vote in the Ways and Means Committee came when the panel approved, 20 to 16, a motion by Rep. Joe D. Waggonner Jr. (D-La.) that effectively struck any tax benefits for parents of elementary and secondary school pupils. The committee then voted 23 to 14 to approve the bill.

On Monday, the panel had voted to provide benefits to parents of youngsters in all elementary and secondary schools - public as well as private and parochial. Yesterday, however, it reversed that position. Members feared including parochial schools would invite a court challenge on constitutional grounds. Rep. Joseph L. Fisher (D-Va.), the only area congressman on the Ways and Means panel, voted for eliminating parochial and elementary-and-secondary pupils from the bill, but against the legislation as it finally was approved.

The overall cost of the legislation would rise to just over $1 billion in 1980 - compared to $1.46 billion for the Carter scholarship aid plan, and $4.5 billion for the Senate tuition tax credit bill. The Senate is about to vote on a scholarship aid plan as well.

The Ways and Means Committee legislation would allow the write-off for those students attending college part-time, provided they are enrolled in courses for at least eight months of the year. Students who foot the bulk of their college tuition could claim the credit instead of their parents.

The action by the committee yesterday marked a dramatic reversal of the panel's previous stand. Unitl just this year, the Way and Means Committee had been a major stumbling block for passage of the legislation.

Rep. Al Ullman (D-Ore.), the committe chairman, who eariler has opposed all tuition credit legislation, gave in when House members refused to consider the Carter scholarship plan without a chance to vote on the tuition credit as well. Ulman voted for the bill yesterday.