South Africa beat Bangladesh by an innings and 273 runs inside three days and swept the two-Test series on Thursday.