With debate over U.S. aid to Nicaraguan rebels as a backdrop, militant Cuban exiles marked the 25th anniversary today of their defeat in a CIA-organized attack against Cuban President Fidel Castro at the Bay of Pigs.

"Twenty-five years ago, we, the freedom fighters of the 60s, were abandoned during the fight for our country and for the two things that have made this country great: freedom and democracy," said Julio Gonzalez, a Bay of Pigs veteran who presided over the ceremony here.

"We . . . urge you in Congress not to make the same mistake with the freedom fighters of the 80s. We can assure you that Nicaragua is the result of a cancer based in Cuba."

The observance recalled the unsuccessful invasion of Cuba April 17, 1961, when a 1,450-man exile force put together by the Central Intelligence Agency tried to overthow Castro two years after he came to power.

The Cuban army crushed the invaders within 72 hours, making effective use of tanks and aircraft to repel the bay landing. Cuban exiles here have contended for years that air cover, which they say their CIA leaders had promised, would have reversed the outcome if President John F. Kennedy had not refused to order U.S. planes into action.

This belief, contested by some experts, has prompted comparisons between the Bay of Pigs and the more recent cut in U.S. military aid to Nicaraguan guerrillas also organized by the CIA.

Aldolfo Calero, chief political figure of the main rebel group, Nicaraguan Democratic Force (FDN), has complained, for example, that his guerrillas are being "Bay of Pigged" by the halt in U.S. money and logistics help.

Jeane J. Kirkpatrick, former U.S. ambassador to the United Nations who spoke at today's ceremonies, said inadequate U.S. support at the Bay of Pigs allowed Castro to turn Cuba into a hemispheric center for export of subversion.

Nicaragua will become a second such center, she added, if the Reagan administration cannot proceed with plans to renew military aid to the Nicaraguan rebels, known as contras.

"I think the people here and all the people of the hemisphere must make clear to Congress that they must support those fighting for freedom and democracy in Nicaragua," she declared.

Kirkpatrick, who as U.N. ambassador played a prominent role in Reagan administration policy for Latin America, has become a champion of sorts to Miami's Cuban exile community and the Nicaraguan rebel leaders. One rebel unit from the Honduras-based FDN calls itself the Jeane Kirkpatrick Task Force.

Kirkpatrick read the group a message from President Reagan to Bay of Pigs veterans saluting their valor and wishing them well. "For 25 years, yours has been a glory that will not pale," Reagan said.

The observance formally inaugurated a center for the Bay of Pigs Veterans Association, or Brigade 2506, in the Little Havana neighborhood that sprang up in Miami with an influx of Cuban exiles and has spread Latin flavor to the entire city.

It was preceded by speeches at a memorial park dedicated to the memory of 107 exiles reported killed in the invasion.

Although Miami's Cubans increasingly have come to regard the United States as their home, the association regularly vows to renew the fight against Castro. A group calling itself the Brigade 2506 Military Command participated today wearing camouflage military uniforms and carrying sidearms and AR15 or M1 rifles.

Association President Miguel Alvarez said the group has sent a letter to Reagan demanding inclusion in the administration's policy of aid for anti-communist guerrilla groups such as those in Afghanistan, Angola and Nicaragua.

"We are prepared to assume this aid to fight once again," he said to cheers from approximately 600 exiles, most of them middle-aged.