You need one entity per row. The way this is setup, $data is going to be an array the length of all of the rules in the table, but each row is going to be a copy of the instance of the last row that was imported.

We should be using the container to get an entity so we don't need to worry about managing its dependencies.