Representative Chris Collins had told so many people, from fellow House members to friends and relatives, about a surefire investment: a little-known Australian drug company that was developing a treatment for multiple sclerosis.

But when Mr. Collins learned about a critical drug trial that had failed, he set in motion a chain of events that led to a federal indictment, the end of his career in Congress and, on Friday, a 26-month prison sentence and a $200,000 fine.

The judge, Vernon S. Broderick of Federal District Court in Manhattan, said that Mr. Collins had a higher obligation to obey the law, given his position in the House and on the board of the drug company, and that he had committed a crime that in many ways went to the heart of the country’s financial system.

“You had a duty to meet, and you betrayed that duty,” the judge said.

The sentence capped a stunning fall for Mr. Collins, of western New York, who rose to prominence after he became the first sitting member of Congress to endorse Donald Trump, a fellow Republican, in the 2016 campaign, and emerged as one of the president’s most ardent supporters.