Why did a freighter attack a cube?
It didnt. The cube attacked the freighter. The freighter, in trying to escape, fired its single photon torpedo more an act of defiance than a real attempt to destroy the cube. When the freighter captain saw that there was no way he could outrun the cube, he hoped that ramming the cube might destroy it. It was a good idea, but wasnt enough to destroy the cube only enough to damage it seriously. Thats why the cube immediately moves to the asteroid to convert it the Archeopendra (who has the knowledge of the on-board Borg at his claw-tips) knew that he needed a better craft. And he had the mega-replicator technology required to build a ship out of the asteroid. That process was almost complete when the warbird stumbled onto the scene.