Villas were named after the Roman villas, because that sounded romantic. Originally, Victorian villas were large buildings. Sometimes they were in rows, like the ones you can see in this picture, and sometimes they were detached mansions.
Of course, people who were less wealthy wanted to be thought to live somewhere grand, so over time, rows of terraced houses for lower middle classes were given a 'villa' label just to make them sound better.