Your contention that "Romans seemed to outfight Macedonian phalanx pretty easily" is not really true. The critical source for you to read here is Plutarch's life of Paulus Aemilius, the Roman general who conquered Macedonia and was the victor at the key battle of Pydna (168 BC). You may also want to read the Wikipedia article on the battle.
If you read Plutarch, you will find that at the beginning of the battle the Roman army was shattered on the phalanx. The Wikipedia article downplays this, but at the time it was a serious setback. Paulus lost a large number of men for no losses to the enemy at all and was in great danger. Eventually Paulus won by waiting for the phalanx to move into hilly terrain and attack in the spaces in between their ranks.
Now, you may ask, why could not hoplites do the same? There were three key factors that aided Paulus:
(1) Plain old soldier strength. The Macedonian empire was very old and rich, and its soldiers weakened by luxury. When Paulus conquered Macedonia, he took immense riches and booty. The Macedonians had ruled the whole Middle East since the time of Alexander and had grown rich and fat. It's a small factor, but do not discount it.
(2) Signalling. The Romans had developed a very elaborate system of signals that allowed them to do complex maneuvers. They used both trumpets and flags to direct men around. For example, mounted officers could race on horseback with a new message from the commander with a flag and direct a maniple to move in a certain way. Without this capability Paulus would not have had the control he needed at Pydna. The hoplites lacked such a system.
(3) Erosion of the Macedonian Cavalry Advantage. Economy grows better over time. As you are able to grow fodder more cheaply, it becomes cheaper and easier to have horses. In Alexander's time Macedonia had a big advantage in that they were an equestrian culture and usually had a larger cavalry than their opponents. This is very important for the phalanx, because the cavalry protects the phalanx's weak spots and acts as a scout for it. The cavalry is also required to chase the enemy and deliver the crushing blow. If the enemy has greater or equal cavalry the phalanx is weaker. This is exactly what happened at Pydna. The Romans had an equal cavalry, and using their signalling systems used their cavalry better. This was what let them find and exploit the weak spots in the phalanx.
Comeback of the Phalanx
In Medieval and Renaissance times there was a comeback of the basic form of the phalanx as "pikemen". The key invention was to put hooks and wide, forged blades on the pikes to fight horses. If the pikemen could take down horses easily, they became very powerful, just like the old phalanx. An example is the Battle of Falkirk in 1298. There was a military genius named Bertrand du Guesclin (1320 – 1380) who was famous for using massed pikemen.