You don't need to use loops at all. You should be thinking in terms of SETS when using a relational database.
Here is the correct way to achieve this. First using the CROSS JOIN to create a cartesian set of all the combinations of ids from tableA and tableB. Then inserting that entire set into TPopulate
INSERT INTO TPopulate (column1, column2)
SELECT T1.PKField
,T2.PKField
FROM TableA T1
CROSS JOIN
TableB T2