Matthews (Sunweb) was the strongest on the uphill sprint which closed out the 166.7km stage from Mataró to Sant Feliu de Guixols to finish ahead of Alejandro Valverde (Movistar) and Daryl Impey (Mitchelton-Scott).
Thomas de Gendt (Lotto Soudal)remained in the overall lead following his Stage 1 victory managed to slightly extend his advantage after finishing with the main bunch. He now leads Valverde and Matthews.
"It was really hard but I was pretty confident in an uphill sprint like this," Matthews said. "After my bad luck this year it's just incredible. I'm so happy.
"Coming into the final kilometres I was able to move up to the front on the downhill and flat before the climb to the finish.
"When I saw Valverde on my wheel, struggling in the sprint, I knew I was going fast and had some good power, so I'm so thankful to my team for believing in me for this long and I came up with a nice victory."
Froome's hopes of winning the 99th edition of the Volta a Catalunya Tour ended after he crashed along with BORA-Hansgrohe's Andres Schillinger and Jay McCarthy with less than 40km to go to.
He finished at his own pace more than 14 minutes behind Matthews in 161st place. The team said he was uninjured except for some lost skin and bruising.
"Froomey crashed just a couple of kilometres before we passed the finish line for the first time," team Sky sports director Nicholas Portal said.
"He still doesn't really know what happened but it was a tricky corner, which had a few roadworks on the right and was also quite bumpy.
"Someone hit him and he slid and crashed. By the time he changed bike and got going the bunch was going too fast and there was no chance to come back. He is here to support Egan this week but it is a shame it happened.
The 179km third stage is one for there climbers as it heads into the mountains finishing in the resort of Valter at 2000 metres altitude in the Pyrenees.
More to come.