Walsh earned his A.B. degree in biology from Harvard University in 1965. As an undergraduate, he worked with E. O. Wilson and published a first author paper in the journal Nature, where he and his colleagues described the composition of the fire ant trail substance. He went on to graduate school at Rockefeller University, where he earned his Ph.D. in life science in 1970.
Walsh completed a postdoctoral fellowship at Brandeis University in 1972, and later that year joined the faculty at Massachusetts Institute of Technology as a professor of chemistry and biology. In 1987, he joined the faculty at Harvard Medical School, where he remains to this day. Walsh has authored more than 650 publications in scholarly journals and trained several graduate students and postdoctoral researchers. Among his professional activities, Walsh is a member of the Board of Scientific Governors of The Scripps Research Institute.