You're conflating the Federalists with the Democratic-Republicans. Madison and Jefferson, who were largely responsible for the first amendment, objected strongly to the Aliens and Sedition Acts. The Federalists were voted out of power in the next election, and the sedition laws were allowed to sunset quickly.