Playing basketball at University High in West Los Angeles, Ecker was named to the All-Western League Second Team in 1965. As a senior, he averaged 20.7 points per game and was named to the All-Los Angeles City First Team. He was also named to the All-Western League First Team along with fellow senior teammate Bill Seibert.
Ecker was not a marquee player for UCLA. Over three championship seasons, he played in nearly every game, though his playing time was limited and typically came when the outcome of the game was already decided. The skinny, 6-foot-6-inch (1.98 m) reserve served as a backup at both forward and center. He is one of 14 players who won three National Collegiate Athletic Association (NCAA) titles at UCLA under Coach John Wooden.
Ecker entered UCLA as a walk-on without an athletic scholarship, and was a starter on the freshman team in 1966–67. He was joined in the lineup by Seibert, his former high school teammate. The following season, Ecker redshirted and did not play. He made the 15-man varsity squad for 1968–69, and served as the team's third-string center.
On the first day of practice in 1969–70, students at UCLA had scheduled a walkout to protest the Vietnam War. Ecker joined teammate Andy Hill, who was also a former high school teammate, in requesting Wooden to cancel practice to support of the antiwar effort, but the coach refused. With the graduation of three-year starting center Lew Alcindor (known later as Kareem Abdul-Jabbar), Ecker was promoted to second-string as starter Steve Patterson's backup. During the season, Ecker made a 4-foot (1.2 m) layup with five seconds remaining for a 72–71 win over Oregon State. He had entered the game for a jump ball with 16 seconds left after Sidney Wicks had fouled out, and controlled the tip before making the winning shot. UCLA finished the season 28–2, and won the national championship game over Jacksonville. At the annual team banquet after the season, Seibert delivered a speech that was highly critical of Wooden. Afterwards, the coach was determined to eliminate "all possible sources of trouble" from the team. He interrogated Ecker, Hill, and Terry Schofield, advising them to transfer from UCLA if they agreed with Seibert, but all three players insisted that they wished to stay.