After the War of 1812, the Republicans gradually adopted many of the economic policies of Alexander Hamilton and the fading Federalists. Why did the Republicans adopt them when they had previously opposed them?
The major reason for this is that the War of 1812 and the years that led up to it brought changes to America. The new circumstances made Hamilton's policies look better.
Before the war, President Jefferson's Embargo Act had forced American manufacturing to arise to fill in for foreign goods that could no longer be had. After the war, imports came back, but the new manufacturing concerns wanted to be protected from the competition. For this reason, the government imposed tariffs.
The federal government also had a better reputation after the war. Things were looking up economically and Americans were feeling nationalistic (instead of just thinking about themselves as being from separate states). This helped lead people like Madison to support a national bank as well. They felt that the people now wanted such a thing and so they should provide it.
I'm not so sure that the Republicans "accepted" Hamilton's policies as they simply did not reverse them as they proved both practical and important. At no time did they concede that Hamilton's ideas may have been correct all along; they simply left them in place as an exercise of the better part of valor.
The Bank of the United States, which Hamilton had championed and Jefferson and Madison opposed, was left in place primarily for pragmatic rather than ideological reasons. Madison as President wrote that the issue of the bank's validity had been decided
by repeated recognitions...of the validity of such an institution in acts of the legislative, executive, and judicial branches of the Government, accompanied by...a concurrence of the general will of the nation.
Jefferson's approach was even more pragmatic. His victory in the election of 1800 had been uncomfortably close. Rather than see the nation further divided along sectional lines, he left many Federalist programs, including the bank, in place to placate those who might stymie his other programs. In fact, in his inaugural address, he said:
We are all Republicans—we are all Federalists. If there be any among us who would wish to dissolve this Union or to change its republican form, let them stand undisturbed as monuments of the safety with which error of opinion may be tolerated where reason is left free to combat it.
Although Jefferson had made a name for himself as a strict constructionist, even he departed from that principle when he deemed it prudent to do so. A prime example was the Louisiana Purchase, for which no Constitutional authority was obvious. Rather than forgo the purchase, he authorized it under the President's power to make treaties, a decidedly broad approach. He justified his decision by stating:
the good sense of our country will correct the evil of loose construction when it shall produce ill effects
Ironically, the Federalists also changed position. They saw the annexation of Louisiana lands into the Union as a move toward the agrarian society which Jefferson loved, and therefore opposed the purchase on strict constitutional grounds.